Skip to content

Instantly share code, notes, and snippets.

@ifnull
Created May 6, 2021 19:40
Show Gist options
  • Save ifnull/bca9621ef405d973fd85070ce81024e3 to your computer and use it in GitHub Desktop.
Save ifnull/bca9621ef405d973fd85070ce81024e3 to your computer and use it in GitHub Desktop.

Revisions

  1. Daniel Smith created this gist May 6, 2021.
    5 changes: 5 additions & 0 deletions check_ssl.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # 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 }'