Get public certificate from an HTTPS service

Save the certificate to publci_cert.pem

openssl s_client -connect <https_service>:443 2>/dev/null \
| sed -n '/BEGIN CERTIFICATE/,/END CERTIFICATE/p' > public_cert.pem

 
Show details of the certificate

openssl x509 -in public_cert.pem -text -noout
About the Author
Freelance Linux DevOps Engineer, Loves to scale things and make stacks intelligent

Leave a Reply

*

captcha *