tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Friebel" <andr...@reynolds.com.au>
Subject Extracting SSL information from servlet
Date Wed, 08 Nov 2006 06:37:05 GMT
I hope I have submitted this question via the correct mechanism.
 
I wish to extract certificate information from my servlet that is
running within tomcat.  The problem that I get is that my x509
certificate array is always null.  The code snippet that I am attempting
to use is:
 
                        X509Certificate[] certs = (X509Certificate[])
request.getAttribute("javax.servlet.request.X509Certificate");
                        
                        if (certs == null) {
// do non-ssl items
                        } else {
 
                        
//                      Attempt to extract principal name from Subject:
                            String clientDN =
certs[0].getSubjectDN().getName();
                            System.out.println("Client DN = " +
clientDN);
                        }
 
My understanding is that when I use the getAttribute as I have above, I
am supposed to get an array of X509Certificate objects.  Instead, certs
is always null.
 
Any ideas?
 
 
Regards,
Andrew Friebel
Franchise Services
Franchise Product Development Coordinator
Reynolds & Reynolds
------------------------------------
Ph: +613 9535 2222
Fax: +613 9535 2281
andrewf@reynolds.com.au <mailto:andrewf@reynolds.com.au> 
reynolds.com.au
partsales.com.au
carservice.com.au
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message