The interfaces are a little different in the macOS versions.
In Safari:
- Click the padlock icon in the URL bar
- Click the Show Certificate button in the dialog that appears
- Click on the certificate icon, and drag it to a Finder window (or the Desktop)
In Google Chrome:
- Click the padlock icon in the URL bar
- If the dialog that appears has a "Connection is secure" line, click on that
- Click the "Certificate is valid" or "Certificate (Valid)" area in the dialog
- If there is a certificate icon, and drag that to a Finder window (or the Desktop); if there isn't an icon, select the Details tab, then click Export.
In Firefox:
- Click the padlock icon in the URL bar
- Click the "Show connection details" (right-arrow) button to the right of "Connection secure" in the dialog that appears
- Click the "More information" area
- Under the Security tab, click the "View Certificate" button
- A "about:certificate?cert=..." browser tab will open; scroll down to the Miscellaneous section
- In the "Download" line, click "PEM (cert)" to save the site's leaf certificate to your Downloads folder, or "PEM (chain)" to save the entire trust chain