Created
May 6, 2021 19:40
-
-
Save ifnull/bca9621ef405d973fd85070ce81024e3 to your computer and use it in GitHub Desktop.
Check SSL cert of localhost virtual host by forcing / overriding the server name.
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
# Solution 1 | |
echo | openssl s_client -showcerts -servername example.com -connect 127.0.0.1:443 2>/dev/null | openssl x509 -inform pem -noout -text | |
# Solution 2 | |
curl --insecure --resolve example.com:443:127.0.0.1 -vvI https://example.com 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment