Skip to content

Instantly share code, notes, and snippets.

@mbilski
Last active September 16, 2015 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbilski/7de2c799c0899d4060b9 to your computer and use it in GitHub Desktop.
Save mbilski/7de2c799c0899d4060b9 to your computer and use it in GitHub Desktop.
Importing SSL cert into java keystore
echo -n | openssl s_client -connect <HOSTNAME:PORT> | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/cert
keytool -importcert -alias "<ALIAS>" -file /tmp/cert -keystore <KEYSTORE> -storepass changeit -noprompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment