How to get website's https certificate on linux command line?


I can use wget or a similar command line tool to get an HTTPS response from a server.

On Firefox/chrome browser, I can simply download the certificate in pem format through the user interface, then add it to my trust host list.
How can I download the same HTTPS certificate through the Linux command line?


>Solution :

Already answered here

Just use openssl command

openssl s_client -showcerts -connect </dev/null 2>/dev/null|openssl x509 -outform PEM >mycertfile.pem

Leave a Reply Cancel reply