mutual authentication

I have the following problem in mutual authentication.

Connection failed: javax.net.ssl.SSLHandshakeException: sun.security.validator.V

alidatorException: No trusted certificate found

At first, I created key and certification as follows.

-

1. Create CA Authority Key using SSL

openssl genrsa -out ca.key 1024

2. Create self-signed CA Certificate

openssl req -new -x509 -key ca.key -out demoCA/cacert.pem

3. Create Client Keystore

keytool -genkey -alias clientapp -keystore clientkeys

4. Create Server Keystore

keytool -genkey -alias serverapp -keystore serverkeys

5. Export public keys from Client and Server keystores

keytool -keystore clientkeys -certreq -alias clientapp -file clientapp.crs

keytool -keystore serverkeys -certreq -alias serverapp -file serverapp.crs

6. Signs both public keys with CA Authority key

openssl ca -in clientapp.crs -out clientapp.pem -keyfile ca.key

openssl ca -in serverapp.crs -out serverapp.pem -keyfile ca.key

7. Convert signed keys to DER format

openssl x509 -in clientapp.pem -out clientapp.der -outform DER

openssl x509 -in serverapp.pem -out serverapp.der -outform DER

8. Import CA certificate to Client and Server keystores

keytool -keystore clientkeys -alias systemca -import -file demoCA/cacert.pem

keytool -keystore serverkeys -alias systemca -import -file demoCA/cacert.pem

9. Import signed key to Client keystore

keytool -keystore clientkeys -alias clientapp -import -file clientapp.der

10. Import signed key to Serverkeystore

keytool -keystore serverkeys -alias serverapp -import -file serverapp.der

-

Then, I copy cacerts which exist in the directory "C:\j2sdk1.4.2\jre\lib\security"

to the directory "truststore/cacerts" like this.

$ keytool -import -keystore -file demoCA/cacert.pem -truststorecacerts -alias trustca

-keystore truststore/cacerts -storepass changeit

Then, I executed programs.

Server:

$ java -Djavax.net.ssl.keyStore=serverkeys -Djavax.net.ssl.keyStorePassword=pas

sword -Djavax.net.ssl.trustStore=truststore/cacerts -Djavax.net.ssl.trustStorePassword=changeit CASSLServer

SimpleSSLServer running on port 4915

Client:

$ java -Djavax.net.ssl.trustStore=/cygdrive/c/eclipse-SDK-2.1.1-win32/eclipse/w

orkspace/xacml/truststore/cacerts -Djavax.net.ssl.trustStorePassword=changeit C

ACustomKeyStoreClient

client error:

Connection failed: java.net.SocketException: Software caused connection abort: s

ocket write error

Server error:

1: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorExceptio

n: No trusted certificate found

1: Closing connection.

Are there something wrong with my setting?

[2900 byte] By [takeuchiyui] at [2007-9-30 15:01:20]
# 1
Hey Did you solve this issue? I found that if I self sign using Keytool it works fine,otherwise if I use Openssl ,it does not. If you have solved it,could you let me know how ? Regards
ruddha at 2007-7-5 21:34:06 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2

> Hey

> Did you solve this issue? I found that if I self sign

> using Keytool it works fine,otherwise if I use

> Openssl ,it does not.

> If you have solved it,could you let me know how ?

>

> Regards

Well As per my knowledge PEM form keystore is not supported by Java it supports only JKS PKCS #12 and JCEKS. I am searching for a tool/script which can convert PEM to JKS or PKCS#12 or any supported format.

thelinker at 2007-7-5 21:34:06 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 3
do you know how to set type PKCS #12 on keytool ?I磎 trying:keytool -genkey -storetype PKCS#12 -alias fup -keypass changeit -keystore fup.keystore -storepass changeitbut it doesn磘 works
Felipe.Gaucho at 2007-7-5 21:34:06 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...