----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Hello.

I'm attempting to authenticate clients connecting to my Web server using
X.509 
certificates.  Here is what I have installed:

Apache 1.3.6
OpenSSL 0.9.3
Apache Jserv 1.1

running on:
Solaris 7 (sparc)


SSL is working and servlets are working, but when I try to access the client
cert with 
the follwing code, I receive null for the cipherSuite:


    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    {
        String msg = "<PRE>";

        // Get the Cipher Suite in use
        String cipherSuite = (String)
req.getAttribute("java.net.ssl.cipher_suite");
        msg += "Cipher Suite: " + cipherSuite + "\n";

        // Get the client's certificate if there are any
        if (cipherSuite != null) {
            X509Certificate certChain[] = 
                (X509Certificate[])
req.getAttribute("java.net.ssl.peer_certificates");
            if (certChain != null) {
                for (int i = 0; i < certChain.length; i++) {
                    msg += "Client Certificate " + i + ":\n";
                    msg += certChain[i].toString() + "\n";
                }
            }
        }
        // write the message to the output stream
        ServletOutputStream out = res.getOutputStream();
        out.print(msg);
        out.close();


Pointers, code, URLs or anything else that moves me in the direction of
getting
this working would be hugely appreciated.

Thanks,

Victor


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to