JSSE/HTTPS certs

I am trying to connect to my apache server with mod_ssl/OpenSSL using a Java application. I have a created a server cert using the opensll and I signed it myself.I get a javax.net.ssl.SSLException: untrusted server cert chain error.

Do I have to purchase a trusted cert to access the site before I can access this site with Java?

Thanks

Edward

[376 byte] By [eb98ac] at [2007-9-26 1:19:00]
# 1
The server certificate you have created is not understood by your client side certificate infrastructure(i.e. client side keystore).Try importing the same server certificate into your client side certificate store.
neville_sequeira at 2007-6-29 0:50:50 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2

Hi Edward,

javax.net.ssl.SSLException: untrusted server cert

This type of error will occur when the certificate being received from the remote server and client are different.

So please check that your store contains the certificate of the remote machine or the CA that signed it and that the certificate that has not expired. Also be sure that both the machines are using the same latest versions of the JSSE.

Hope this will help you.

Regards,

Anil.

Technical Support Engineer.

ramanil_indts at 2007-6-29 0:50:50 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 3
HI.My case is same.Client is JSSE, and server is OpenSSL.How can I import the self-signed certificate.Can you show me the importing code please?thanks
netiac at 2007-6-29 0:50:50 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 4

Hi,

there are some possible problems you could be encountering :

1. If using https, the certificate has to include the hostname of the server, which is in possession of the private key from which you created the certificate.

Client-side https checks, wether the name in the certificate corresponds to the hostname of the server which posted the certificate.

2. The server-certificate has to be imported into the clients truststore. You can use keytool (included in the jdk) for this task.

the following statement imports the certificate 'testkeys' contained in the file 'testkey.cert' into the truststore 'cacerts' :

keytool -import -keystore cacerts -alias testkeys -file testkey.cert

mhansohm at 2007-6-29 0:50:50 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...