How to download invalid or self-signed HTTPS certificate without OpenSSL by using Google Chrome

When you need to acquire a public server certificate in PEM format from a web server and you do not have OpenSSL tools then you can use one “hidden” feature of Google Chrome.

Just open HTTPS URL in Google Chrome. You’ll see an error:

Your connection is not private.
NET::ERR_CERT_COMMON_NAME_INVALID

Do not click on Advanced or Reload.

Just click letters NET::ERR_CERT_COMMON_NAME_INVALID and PEM certificate will appear directly in the browser.

Now you can copy PEM encoded chain and paste it to your text editor.