Created
December 5, 2012 05:30
-
-
Save holly/4212625 to your computer and use it in GitHub Desktop.
openssl key and cert debug pair one-liner function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
debug_keypair() { (openssl s_server -cert $2 -key $1 -CAfile $3 -www -no_ssl2 -accept 4433) & sleep 1; if ! lsof -i:4433; then return 1; fi; jobid=$(jobs %?"openssl s_server" | sed -e 's/^\[\(.\+\)\].*/\1/'); openssl s_client -connect localhost:4433 -showcerts -ssl3 -CAfile $3 </dev/null; kill %$jobid; return 0; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ debug_keypair /path/to/server.key /path/to/server.crt /path/to/CA.pem(or CA-middle.pem) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment