Created
October 18, 2018 13:17
-
-
Save wietze/2fde8c9386628d9f2133a263481e2eb5 to your computer and use it in GitHub Desktop.
One-liner to obtain the PEM file of a domain/port combination
This file contains 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
python -c "import sys,ssl;print(ssl.get_server_certificate((sys.argv[1], sys.argv[2])))" $DOMAIN $PORT > output.pem | |
# Example: | |
# $ python -c "import sys,ssl;print ssl.get_server_certificate((sys.argv[1], sys.argv[2]))" google.com 443 > google.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment