Hello

I run my servlets on apache with mod SSL configurated for mutual
authentification
(the client must also send his certificate to the server for
authentification)

And i want to get the client certificate in a servlet. But i don't know how
i can do that !

I tried to use the follow code but it seems to work only with Java Web
Server.

  String cipherSuite = (String)
req.getAttribute("javax.net.ssl.cipher_suite");
  out.println("Cipher Suite" + cipherSuite);

  if(cipherSuite != null)
  {
    X509Certificate certChain[] = (X509Certificate) req.getAttribute
("javax.net.ssl.peer_certificates");
    if (certChain != null)
    {
      for (int i=0; i< certChain.length; i++)
      {
        out.println("Client Certificate ["+i+"] = " +
certChain[i].toString());
      }
    }
  }


Please HELP ME ! :-)

Thierry

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to