I have a webapp-1 deployed on a SUNWappserver that requires two way SSL authentication. I can write a java client-1 for it, and it works just fine.
However, when I write a client-2 for webapp-1 as a webservice (instead of a standalone java program), I am having problems.
I am deploying client-2 on a jetty-8 server. During SSL-handshake, Jetty first gets the certificate from SUNWappserver (which is okay: Found trusted Certificate), Jetty then receives a CertificateRequest from the SUNWappserver (along with the Cert Authorities). However, Jetty then just replies with an empty Certificate chain.
.
.
*** CertificateRequest
Cert Types: RSA, DSS
Cert Authorities:
****<CNs removed from here>****
*** ServerHelloDone
*** Certificate chain
***
*** ClientKeyExchange, RSA PreMasterSecret, TLSv1
.
.
I am not sure whats happening there. Is there some setting in the jetty-ssl.xml configuration that I need to enable, so that it replies with the certificate chain? Here are the options that I am using right now
<Set name="KeyStore"><SystemProperty name="jetty.home" default="." />/server-certs/keyStore.jks</Set>
<Set name="KeyStorePassword">$PASS</Set>
<Set name="KeyManagerPassword">$PASS</Set>
<Set name="TrustStore"><SystemProperty name="jetty.home" default="." />/server-certs/trustStore.jks</Set>
<Set name="TrustStorePassword">$PASS</Set>
<Set name="certAlias">$CORRECT_ALIAS</Set>
<Set name="wantClientAuth">true</Set>
My trustStore and keyStore are fine as they work when I use client as a standalone java application (instead of deploying on a jetty server). Jetty is reading the keyStore and trustStore correctly when I start Jetty server. I have also tried giving -Djavax.net.ssl.trustStore etc. as the jvm options while starting the Jetty server.