This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes Tomcat and the fly likes Cannot retrieve client cert when requesting javax.net.ssl.peer_certificates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Products » Tomcat
Bookmark "Cannot retrieve client cert when requesting javax.net.ssl.peer_certificates" Watch "Cannot retrieve client cert when requesting javax.net.ssl.peer_certificates" New topic
Author

Cannot retrieve client cert when requesting javax.net.ssl.peer_certificates

Bryan Pan
Greenhorn

Joined: Oct 14, 2011
Posts: 1
Hi all,

I am upgrading from Tomcat 6.0.18 to 7.0.21 (32-bit Win zip).

Previously, when requesting a client certificate I would use:

X509Certificate[] certs = (X509Certificate[])req.getAttribute("javax.net.ssl.peer_certificates");

However, after upgrading to 7.0.21 this no longer works. Instead it returns null.

However, I can retrieve the client certificate when I use:

X509Certificate[] certs = (X509Certificate[])req.getAttribute("javax.servlet.request.X509Certificate");

I'm curious as to why the javax.net.ssl.peer_certificates parameter no longer works in this case. Is it an issue cause by a Tomcat regression change?
Also I have only been able to find a reference to it in the 2.1 servlet specification. However, while using tomcat 6.0.18 I was using servlet 2.5.
 
rocket mass heater kickstarter
 
subject: Cannot retrieve client cert when requesting javax.net.ssl.peer_certificates