Skip to content

Instantly share code, notes, and snippets.

@holly
Created December 5, 2012 05:30
Show Gist options
  • Save holly/4212625 to your computer and use it in GitHub Desktop.
Save holly/4212625 to your computer and use it in GitHub Desktop.
openssl key and cert debug pair one-liner function
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; }
$ 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