Might want to look at this blog post first.
- Enable SSL with Glassfish v3
- A signed PEM SSL certificate:
<fqdn>.crt
- A pkcs8 key for your certificate:
<fqdn>.key
- A Java Keystore containing your certificate and the full chain back to the root certificate
openssl pkcs8 -topk8 -nocrypt -in <fqdn>.key -inform PEM -out <fqdn>.key.der -outform DER
openssl x509 -in <fqdn>.crt -inform PEM -out <fqdn>.der -outform DER
openssl x509 -in <intermediate cert n>.crt -inform PEM -out <intermediate cert n>.der -outform DER
...
openssl x509 -in <intermediate cert 0>.crt -inform PEM -out <intermediate cert 0>.der -outform DER
openssl x509 -in <root cert>.crt -inform PEM -out <rott cert>.der -outform DER
cat <fqdn>.crt <intermediate cert n>.der ... <intermediate cert 0>.der <root cert>.der > <fqdn>-full-chain.der
javac ImportKey.java
java -cp . ImportKey <fqdn>.key.der <fqdn>-full-chain.der
This results in a keystore.jks
file containing your certificate under the alias importkey
.
keytool -importkeystore -srckeystore keystore.jks -destkeystore <domaindir>/config/keystore.jks
Just go to your admin console and select the alias importkey
as "Certificate Nickname" under Configurations -> server-config -> HTTP Service -> Http Listeners -> http-listener-2 on the SSL tab.
- Jochen Seifarth
- Joachim Karrer
- Jens Carlberg
- Sven Schober (minor additions)