8

I would like to download a certificate in PEM format...

-----BEGIN CERTIFICATE-----
XoSDIKaItcRzMGrVqFPY9lG72Oe68lnLZWYQSkvqePC/04QnapOP...
(...)
-----END CERTIFICATE-----

...directly from a web browser, visiting a HTTPS website. Is there any browser function or add-on that allows doing so?

I'm using Chrome under Win10 but answers about other browsers/OSes can be useful.

I'm not trying to do this using UNIX command line tools e.g.

openssl s_client -connect mysite:443 > tmpfile
dr_
  • 4,746

1 Answers1

11

A PEM is a particular format. If you don't have a file in PEM format you won't be able to download it as a PEM file. What you can do is get the certificate information and convert it to whatever format you need.

From your responses it doesn't look like you're actually interested in downloading file but rather saving a certificate that's used for an HTTPS connection as a PEM file. In that case (at least for Firefox and Chrome) view the details of the certificate that is being used and choose to save it as a file.

For Firefox do the following:

Click on the Lock > Arrow > More Information > View Certificate > Details > Export

Fore Chrome:

Click on the Lock > Valid > Details > Copy to File

Save a certificate using chrome

The actual save function won't allow for a PEM so you will have to convert it afterwards e.g. using openssl.

How to save a remote server SSL certificate locally as a file also contains information in case it's not possible to view that information in your chrome using these steps.

For steps on how to convert the resulting file have a look at How to convert .crt to .pem [duplicate]. It's essentially openssl x509 -in mycert.crt -out mycert.pem -outform PEM.

Seth
  • 9,393