When making a secure connection via a java client such as commons-http, the JVM looks for a cert to be available and most client libraries do not try to negotiate the certs automatically, so you will need to import it to your keystore. This is the simplest explanation I could muster for what you will need to do to make a HTTPS connection by java.
claygraham@gaudi:~/tmp$ echo | openssl s_client -connect api.welocally.com:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/tmp/api.welocally.com.cer claygraham@gaudi:~/tmp$ openssl x509 -text -in ~/tmp/api.welocally.com.cer claygraham@gaudi:~/tmp$ sudo keytool -delete -alias api.welocally.com -keystore $JAVA_HOME/Home/lib/security/cacerts claygraham@gaudi:~/tmp$ sudo keytool -import -alias api.welocally.com -keystore $JAVA_HOME/Home/lib/security/cacerts -file ~/tmp/api.welocally.com.cer



Comments are closed.