Client and server share each others key+public certificate hence client auth succeeds.
More...
Client and server share each others key+public certificate hence client auth succeeds.
Client and server share each others key+public certificate hence client auth succeeds.
Setup
Generate the Client and Server Keystores
-
keytool -genkeypair -alias serverkey -keyalg RSA -dname "CN=localhost,OU=Organization Unit,O=Organization,L=City,S=State,C=IN" -keypass password -keystore serverkeystore.jks -storepass password
-
keytool -genkeypair -alias clientkey -keyalg RSA -dname "CN=localhost,OU=Organization Unit,O=Organization,L=City,S=State,C=IN" -keypass password -storepass password -keystore clientkeystore.jks
Install the client's key in to the server's keystore
-
keytool -importkeystore -srckeystore clientkeystore.jks -destkeystore serverkeystore.jks -srcstoretype JKS -deststoretype JKS -srcstorepass password -deststorepass password -srcalias clientkey
Install the server's key in to the clients's keystore
-
keytool -importkeystore -srckeystore serverkeystore.jks -destkeystore clientkeystore.jks -srcstoretype JKS -deststoretype JKS -srcstorepass password -deststorepass password -srcalias serverkey
Check keystore contents
-
keytool -list -keystore serverkeystore.jks -storepass password
-
keytool -list -v -keystore serverkeystore.jks -storepass password -alias serverkey1
-
keytool -list -v -keystore clientkeystore.jks -storepass password -alias clientkey