Link to home
Start Free TrialLog in
Avatar of knightEknight
knightEknightFlag for United States of America

asked on

Client Certificate Information not available to Servlet running on Apache + WebLogic Configuration

I am trying to access the client certificate information from a JSP using the following code with no success:

import java.security.cert.X509Certificate;
X509Certificate certChain[] = (X509Certificate[]) request.getAttribute("javax.net.ssl.peer_certificates");

if( certChain != null )
{
     for (int i=0; i < certChain.length; i++)
     {
          String a = certChain[i].toString();
          System.out.println(a);
                //...
     }
}

The certChain array comes back null.  Apache has been configured to require SSL communication and client certificate authentication.  I have tried with WebLogic requiring and not requiring client certificates with the same results.  

I also tried the following code but the return value came back null also:
   request.getUserPrincipal();

Avatar of boxy73
boxy73

Is your weblogic listening on SSL (usually 7002) port for JSP requests?
Avatar of knightEknight

ASKER

yes, weblogic is listening on SSL.  Apache is not passing the certificate thru to weblogic.
ASKER CERTIFIED SOLUTION
Avatar of boxy73
boxy73

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
that was not an option because the classes were not even on the same tree together ... but that problem was for my previous employer anyway, so who cares!  Thanks anyway.