I have a wildcard certificate I want to install in a Glassfish v4 server.
After converting certificate format and importing it to java keystore (using commands already discussed in other topics) we have to configure file domain.xml
to include a password for JKS. Something like:
<jvm-options>-Djavax.net.ssl.keyStore=/myappdir/keystore.jks</jvm-options>
<jvm-options>-Djavax.net.ssl.keyStorePassword=changeit</jvm-options>
<jvm-options>-Djavax.net.ssl.trustStore=/myappdir/cacerts.jks</jvm-options>
<jvm-options>-Djavax.net.ssl.trustStorePassword=changeit</jvm-options>
<jvm-options>-Djavax.net.ssl.keyAlias=myapp-cert</jvm-options>
<jvm-options>-Djavax.net.ssl.keyStoreAlias=myapp-cert</jvm-options>
<jvm-options>-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=myapp-cert</jvm-options>
The problem here is that a password for JKS must be inserted into file domain.xml
(see -Djavax.net.ssl.trustStorePassword=changeit
), which I think is not a good deal for security reasons.
Does anyone knows a better way of importing a certificate to glassfish v4 without storing the password into configuration files?