users@glassfish.java.net

Add a self-signed certificate to a truststore.

From: Erwin Rehme <erwin.rehme_at_oracle.com>
Date: Mon, 15 Mar 2010 11:08:07 -0600

I have some client code running in glassfish that needs to connect to a
server using SSL. I have been given the .rfc file for the self-signed
certificate of the server and I'm trying to add it to my .asadmintruststore.

The command:

  certutil -A -n SampleSSLServerCert -t "u,u,u" -d
/opt/SUNWappserver/domains/domain1/config/ -i /SampleSSLServerCert.rfc

adds the cert to the db but when I do:

  certutil -L -d /opt/SUNWappserver/domains/domain1/config

I get:

  SampleSSLServerCert ,,

and:

  certutil -V -u V -d /opt/SUNWappserver/domains/domain1/config -n
SampleSSLServerCert

says that the cert is invalid.

If I use -t "P,P,P", the certificate is valid but when I delete
.asadmintruststore and run:

  asadmin list-jms-hosts

I get a prompt that asks me if I want to trust the app server
certificate but I don't get a prompt to trust the self-signed certificate.

Does the self-signed cert need to be added to the db using -t "u,u,u"
and if so, how to I do that?

If I can use -t "P,P,P" to get a valid cert into the db, how do I get
that self-signed cert into .asadmintruststore?

Thanks for your help.

-- Erwin