Meaningless Drivel is fun!*
The moose likes Tomcat and the fly likes how can I get a X509Certificate from tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "how can I get a X509Certificate from tomcat" Watch "how can I get a X509Certificate from tomcat" New topic
Author

how can I get a X509Certificate from tomcat

qs Wang
Greenhorn

Joined: Nov 04, 2002
Posts: 7
I have successfully config the ssl for tomcat , then , I make a "jsp" file contain the follow:
java.security.cert.X509Certificate certChain[] = (java.security.cert.X509Certificate[])request.getAttribute("javax.net.ssl.peer_certificates");
if (certChain != null)
{
//Now in SSL and can use the certificate information to query
//the user and authenticate
out.println("<h1>HTTPS Information:<h1>");
out.println("<pre>");

for (int i = 0;i < certChain.length;i++)
{
out.println(i);
X500Name issuer = certChain[i].getIssuerName().getName();
//doSomethingWith(issurer);
}
}
but , "certChain" is null. why? it is sure that I send a Certificate from the client(IE), why I can not get the Certificate from tomcat. who can help me ? tks all!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can I get a X509Certificate from tomcat
 
Similar Threads
HTML to Servlet?
how can I get a X509Certificate from tomcat
featchin security info. in jsp
Servlets and SSL
Read client certificate in a Servlet