I was playing keystore and keytool today to add certifcate.
- Openssl command to export certifcate from remote url and save to pubcert.crt : openssl s_client -connect <domain>:443 -showcerts < /dev/null | sed -ne ā/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/pā > /tmp/pubcert.crt
- keytool -import -trustcacerts -alias <aliasname> -file /tmp/pubcert.crt -keystore test.jks -storepass <passpword> -noprompt
- To test the connectvity using SSL poke: java -Djavax.net.ssl.trustStore=<path of jks> SSLPoke <domainname> 443
Successfully connected - SSL Poke Installation : https://confluence.atlassian.com/kb/unable-to-connect-to-ssl-services-due-to-pkix-path-building-failed-779355358.html