tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Gilbertson <eric.gilbert...@secretseal.com>
Subject Get "java.lang.ClassCastException" when extracting an X509Certificate from an HTTP request
Date Thu, 16 May 2002 15:30:09 GMT
Following an example from Hall's More Servlets book, I had attempted extracting
a cert from a HTTP request using the following:

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

which generated a difficult to debug class cast exception. The answer 
(thanks to a post from
John Brayton) is of course that you need a cert array instead, eg:

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

I am submitting this as a follow up to Mr. Brayton's post so that others 
can locate the problem
quicker.

Regards,

Eric Gilbertson
eric.gilbertson@secretseal.com



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message