Skip to content

Instantly share code, notes, and snippets.

@yildirima
Last active March 19, 2019 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yildirima/d09bebe1cd2ca21abb98e351e82225d0 to your computer and use it in GitHub Desktop.
Save yildirima/d09bebe1cd2ca21abb98e351e82225d0 to your computer and use it in GitHub Desktop.
#!/bin/bash
host=$1
verify=$2
openssl s_client -showcerts -verify $verify -connect $host:443 < /dev/null | awk '/BEGIN/,/END/{ if(/BEGIN/){a++}; out="certout"a".pem"; print >out}'
openssl x509 -noout -text -purpose -in certout1.crt
openssl x509 -noout -text -purpose -in certout2.crt
######How to run script###########
# bash test.sh google.com 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment