Download PEM via browser only

5

2

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

dr01

Posted 2018-02-02T14:59:12.943

Reputation: 2 509

Which browser? Which Operating System? – garethTheRed – 2018-02-02T18:13:07.750

Chrome under Win10 but it isn't strictly important. – dr01 – 2018-02-05T08:12:23.403

Generate the PEM, put it in a directory (that's accessible) and download it? – Seth – 2018-02-05T08:38:56.300

@Seth I don't want to generate a certificate, I want to download it from a existing HTTPS website. – dr01 – 2018-02-05T08:44:31.617

Answers

6

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

Posted 2018-02-02T14:59:12.943

Reputation: 7 657

2Thanks, this worked. Actually there's no need to use OpenSSL, it's possible to save the cert in PEM format by selecting the second option "Base-64 encoded X.509 (.CER)" after "Copy to file". – dr01 – 2018-02-05T09:10:05.047