Skip to content

Instantly share code, notes, and snippets.

@chulkilee
Created December 13, 2017 23:09
Show Gist options
  • Save chulkilee/c431d2173271041f3f6f9bc77f0d17db to your computer and use it in GitHub Desktop.
Save chulkilee/c431d2173271041f3f6f9bc77f0d17db to your computer and use it in GitHub Desktop.
Get cert chain
servername=
port=
echo \
| openssl s_client -showcerts -servername $servername -connect $servername:$port 2>&1 \
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \
> $servername.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment