That depends of the webserver or the servlet server ??

I work with apache and JServ.



-----Original Message-----
From: Nick McKenna [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 25, 2000 10:06 AM
To: [EMAIL PROTECTED]
Subject: Re: How can i get a certificate in a servlet ?


Dear Thierry

The certificate acquisition stuff varies between web servers. I don't know
how to do it with Apache, but the following works with iPlanet:

      Object cert =
request.getAttribute("javax.servlet.request.X509Certificate");
      X509Certificate certificate = (X509Certificate) cert;

It may be the same for Apache...

Nick.

-----Original Message-----
From: BERWART Thierry [mailto:[EMAIL PROTECTED]]
Sent: 25 August 2000 08:52
To: [EMAIL PROTECTED]
Subject: How can i get a certificate in a servlet ?


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


***************************************************************
The contents of this Email and any files transmitted with it
are confidential and intended solely for the use of the
individual or entity to whom it is addressed. The views stated
herein do not necessarily represent the view of the company.
If you are not the intended recipient of this Email you may not
copy, forward, disclose or otherwise use it or any part of it
in any form whatsoever. If you have received this mail in
error please Email the sender.
***************************************************************

___________________________________________________________________________
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

___________________________________________________________________________
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