Java & SSL with Certificates

Hi, I’m trying HTTP POST from a Java agent into a remote server (non Domino, but not relevant I guess). The two systems (our Domino server and remote server) have SSL certificates in common, we know they work because, from a LotusScript agent I can successfully call a db.GetDocumentByURL and return a protected page.

However, I’m really struggling with regard to how/where I should be referencing these certificates to make the Java agent work, currently we get:

12/07/2008 01:05:39 Agent Manager: Agent printing: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate

I’ve imported the CA certificate and signed certificate request into cacerts using keytool, but there’s a third certificate (I guess remote server public key) which in the Domino environment has been imported into a person document. When I sign a LotusScript based agent with this user, I can make the successful db.GetDocumentByURL call on a protected resource.

In summary, where should the SSL certificates (all three of them) be imported/referenced in order to make my Java agent successfully handshake with the remote server, I’m pulling my hair out here, any input would be greatly appreciated :o)

Cheers.

Phil.

Subject: Solved

To help out anyone dealing with this issue, the solution is simply that another certificate is required for the JVM. Follow the relevant keytool procedures, broadly:

From the command line:

Change directory to \jvm\lib\security

Generate a key.

Generate a key request.

Send CSR from previous request to CA.

Receive Signed request back from CA.

Import Certificate Authority.

Import Received Signed request from CA (must use same alias as used to generate the key above)

Import Additional certificate.

and you’ll be in business.

Cheers.

Phil.