Hi i have a servlet that is deployed on tomcat designed to communicate with server written as a plain java class. Both servlet and server are to communicate using SSL mutual authentication.
When i am running server on port 9000
Server starting...
Server started on port 9000
Waiting for clients...
Connected. Cipher Suite: Unknown 0x0:0x0
Request from client received...
javax.net.ssl.SSLException
: Connection has been shutdown: javax.net.ssl.SSLHands
hakeException: Received fatal alert: certificate_unknown
And the servlet running on the tomcat is giving this exception:
javax.net.ssl.SSLException
: Connection has been shutdown: javax.net.ssl.SSLHandshake
Exception:
sun.security.validator.Val
idatorExce
ption: No trusted certificate found
Both servlet and server exchange certificates for authentication. I am creating certificates using OpenSSL.These are the steps i am following to create keystore and truststore on both sides:
1. creating a server keystore:
keytool -genkey -alias server -keystore server_keystore
2. creating a client keystore
keytool -genkey -alias client -keystore client_keystore
3. creating cert requests from both the keystores
4. create a 1024-bit private key to use when creating CA.:
C:\ssl>openssl genrsa -des3 -out keys/ca.key 1024
5.create a master certificate based on this key, to use when signing other certificates:
C:\ssl>openssl req -config openssl.conf -new -x509 -days 1001 -key keys/ca.key -out certs/ca.cer
6.Sign both the requests as follows:
C:\ssl>openssl ca -policy policy_anything -config openssl.conf -cert certs/ca.cer -in requests/certreq.txt -keyfile keys/ca.key -days 360 -out certs/iis.cer
7.Converting the signed certificate into x509 format for use with IIS:(for both the client and server request certs)
C:\ssl>openssl x509 -in certs/iis.cer -out certs/iisx509.cer
8. storing the signed server cert in server keystore and client truststore using keytool import
9. storing the signed client cert in client keystore and server truststore using keytool import.
Placing the client keystore and truststore in tomcat and placing the server keystore and truststore in folder where server is running.
By seeing the steps mentioned above am i missing anything. Please suggest me solution this is very urgent