I am trying to enable SSL on a project on Netbeans IDE and using Glassfish application Server.
For the SSL; i followed the procedure below.
- Generated a keystore >
keytool -genkey -alias client_keystore -keyalg RSA -keystore client_keystore.jks -keysize 2048
- Generated a CSR >
keytool -certreq -alias client_keystore -file yourcsrname.csr -keystore client_keystore.jks
- Submitted the CSR to another party.
- Received three .pem certificates from the party. I converted the .pem to .crt as
openssl x509 -outform der -in your-cert.pem -out your-cert.crt
- Importing the certs to my keystore as below;
keytool -import -trustcacerts -alias intermediate -file GoDaddy_Intermediate.crt -keystore client_keystore.jks
keytool -import -trustcacerts -alias root -file GoDaddy_Root.crt -keystore client_keystore.jks
keytool -import -trustcacerts -alias BizSwitch -file BizSwitch.crt -keystore client_keystore.jks
- Import the keystore to the default glassfish keystore >
keytool -importkeystore -srckeystore ~/Downloads/ipay/client_keystore.jks -destkeystore keystore.jks
- Restarted glassfish server.
I am not sure if that's all but I am getting the sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
exception.
On restarting, from the glassfish logs I do not see the certificates being loaded as well.
Am I missing something?