Skip to content

Instantly share code, notes, and snippets.

@fooling
Created August 1, 2016 09:24
Show Gist options
  • Save fooling/bb7f78bdf06d0f0ce76f56ae5ca7f1ff to your computer and use it in GitHub Desktop.
Save fooling/bb7f78bdf06d0f0ce76f56ae5ca7f1ff to your computer and use it in GitHub Desktop.
Get cert
获取任意https的证书并加入java keystore
openssl s_client -connect 192.168.1.1:443 </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > xxx.cert
keytool -import -v -trustcacerts -file /home/xxx/xxx.cert -keystore "$JAVA_HOME/jre/lib/security/cacerts" -keypass ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment