Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Retrieving certificate info...

Reply
Thread Tools

Retrieving certificate info...

 
 
ohaya
Guest
Posts: n/a
 
      08-17-2004
Hi,

I have an SSL-enabled Apache + Tomcat with mod_jk2. Apache is configured
to require client certificates, and I've confirmed that this client
authentication seems to be working (see below).

I have a JSP where I want to retrieve some info from the client
certificate.

Here's the code that I'm trying to use for retrieving the certificate
info:

out.println("<BR><BR><B>Client Certificate Info:</B><BR>");
X509Certificate[] certs =
(X509Certificate[])request.getAttribute("javax.servlet.request.X509C ertificate");
if (certs != null)
{
X509Certificate cert = certs[0];
String dn = cert.getSubjectDN().getName();
out.println(dn);
}
else
{
out.println("Certs returned NULL");
}

BUT, I am finding 'certs' is always null !!

I added some additional code to display some other info from the
request:

Client Info:
request.getRemoteHost(): jimnew.foo.com
request.getRemoteAttr(): 192.168.0.120
request.getProtocol(): HTTP/1.1
request.getScheme(): https
request.isSecure(): yes
request.getAuthType(): null
request.getRemoteUser(): null
request.getMethod(): GET
request.getRequestURI(): /showcert.jsp
request.getServletPath(): /showcert.jsp
request.getContentType(): null
request.getContentLength(): 0
request.getCharacterEncoding(): null

When I connect with a client, I am getting a popup asking to select my
client certificate.

Can anyone tell me why the 'certs' is always returning null, and how can
I retrieve the DN/subjectName?

Thanks,
Jim
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving document's certificate in JS Peter Javascript 4 05-19-2008 07:25 PM
Win32::OLE and CAPICOM to find a certificate in certificate store will raise exception danielhe99@gmail.com Perl Misc 0 07-20-2006 06:47 AM
Thunderbird stops retrieving messages relaxing cardshark Firefox 3 06-08-2005 11:12 PM
Server disconnect after retrieving email gwtx2 Firefox 4 12-18-2004 11:20 PM
How to Import Certificate file into windows certificate store under IWAM account Helena Cai ASP General 0 08-29-2004 05:27 AM



Advertisments