Skip to content

Instantly share code, notes, and snippets.

@NaserKhoshfetrat
Last active April 26, 2022 08:37
Show Gist options
  • Save NaserKhoshfetrat/f510d6bd0091ba747a45e4af866bc3b1 to your computer and use it in GitHub Desktop.
Save NaserKhoshfetrat/f510d6bd0091ba747a45e4af866bc3b1 to your computer and use it in GitHub Desktop.
get publick key
openssl s_client -servername HOSTURL -connect mydomain.com:443 | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
openssl x509 -in ~/Downloads/certi_pem.cer -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
openssl s_client -servername HOSTURL -connect myhost.com:443 | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | hexdump -v -e '/1 "%02x"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment