You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Shankar Unni <sh...@netscape.net> on 2006/08/01 23:37:51 UTC

Re: HTTPS connector and clientAuth=want: how to retrieve client cert in servlet?

Shankar Unni wrote:

>> However, I'm stuck trying to retrieve the client certificate from the 
>> ServletRequest in the servlet itself.

Never mind - I had botched the truststore setup for the server, so the 
client cert was not being passed in.

Answer for the archives:

     import java.security.cert.X509Certificate;

     String certAttrName = "javax.servlet.request.X509Certificate";
     X509Certificate[] certchain =
       (X509Certificate[])request.getAttribute(certAttrName);


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org