users@glassfish.java.net

Keytool import error

From: <glassfish_at_javadesktop.org>
Date: Fri, 16 Jul 2010 02:41:07 PDT

Good Day,

I have installed the following version of GlassFish Application Server,

 # ./asadmin version
Version = Sun GlassFish Enterprise Server v2.1.1

I followed the below steps to install a certificate signed by a CA,

1. Deleted the existing certificate using the following command,
keytool -delete -alias s1as -keystore keystore.jks -storepass <store_passwd>

2. Then generated the key pair
keytool -genkeypair -keyalg RSA -keystore keystore.jks -validity <val_days> -alias s1as

3. Then created a certificate request for getting it signed by CA
keytool -certreq -alias s1as -file <certreq_file> -keystore keystore.jks -storepass <store_passwd>

4. Then importing the signed certificate
keytool -import -v -alias s1as -file s1as.cert -keystore keystore.jks -storepass <store_passwd>

The above steps where given by CA using the the url, http://blogs.sun.com/enterprisetechtips/entry/using_ssl_with_glassfish_v2.

When trying to import the certificate I get the following error,

# keytool -import -v -alias s1as -file s1as.cert -keystore keystore.jks -storepass <store_passwd>

keytool error: java.lang.Exception: Failed to establish chain from reply
java.lang.Exception: Failed to establish chain from reply
        at sun.security.tools.KeyTool.establishCertChain(KeyTool.java:2662)
        at sun.security.tools.KeyTool.installReply(KeyTool.java:1870)
        at sun.security.tools.KeyTool.doCommands(KeyTool.java:807)
        at sun.security.tools.KeyTool.run(KeyTool.java:172)
        at sun.security.tools.KeyTool.main(KeyTool.java:166)

It would be really nice if someone could help me out here and few forums suggest to convert the format of the certificate file to pkcs#7 format, but I dont find the exact commands to do it. I used the tool suggested in the below url, but didnt help.

https://www.sslshopper.com/ssl-converter.html.

It would be really nice if someone could help since I have been stuck with the issue for almost 4 weeks.

Thanks in Advance.
[Message sent by forum member 'soma2810']

http://forums.java.net/jive/thread.jspa?messageID=477794