How to Export Certificate from Chrome on a Mac?
Asked Answered
D

9

119

How do I export a security certificate from Chrome v37 on a Mac?

Previously I could click on the little lock icon next to the URL, select "Connection," select the certificate, and an "Export" button would appear.

Not so anymore!

Delossantos answered 19/9, 2014 at 18:38 Comment(2)
To prevent scrolling: hold down option key & drag the certificate icon from the dialog into a texteditor.Koziol
For an up-to-date answer see How to save SSL certificate by chrome and firefox on Mac?Scanties
A
165

Edit 4/3/19: I have found a workaround. This is tested on Chrome for Mac 73.0.3686.86 64-bit, platform: macOS 10.14.4:

  1. Open a new TextEdit document.
  2. In TextEdit, click Format | Make Plain Text.
  3. Arrange windows so that the TextEdit window and the Chrome window are both visible.
  4. In Chrome, click the icon to the left of the URL in the address bar.
  5. In the dropdown list, click Certificate.
  6. Hold down Option and drag from the large certificate icon to the body of the TextEdit document. Note: If you did not follow the steps above in exactly the order stated, you may need to first single-click within the Chrome window so that TextEdit doesn't become hidden when you Option-click.
  7. Save the TextEdit document with a .pem extension.

If you don't hold down Option when you drag, then you will instead get the certificate contents in human-readable form, which can also be handy.

(Edited 2/24/19: @RichardTopchiy is correct, this no longer works. Testing on Chrome 72.0.3626.119 64-bit. I don't know of any workaround at the present.)

(Edited 2/10/17: I have added a more up-to-date answer in a comment: How to Export Certificate from Chrome on a Mac?)

  1. Click the icon to the left of the URL.
  2. In the box that pops up, click the Connection tab.
  3. Click the Certificate Information link.
  4. A box pops up showing information about the certificate. Drag the large certificate icon to a Finder window. A .cer file will be created in the location you drag it to.

This is based on Chrome 42.0.2311.135 (64-bit) for Mac.

Antennule answered 11/5, 2015 at 21:24 Comment(18)
This works on Chrome for Mac 54.0.2840.98 (64-bit). Thanks.Megan
No longer there on 56.0.2924.87 (64-bit). :( Go to developer tools > security tab. But you still can't export it.Rehabilitate
@nomadic-squirrel Exporting still works (I'm also on 56.0.2924.87 64-bit). After you click the "View certificate" button, in the dialog that comes up, drag the large certificate icon to a Finder window. So, full instructions are: Ellipsis menu (to the right of the address bar) | More Tools | Developer Tools | chevron menu (top right of developer tools pane) | Security | (on Security tab) View certificate | Drag large certificate icon to your desktop or any Finder window.Antennule
Dragging the large certificate icon to a Finder window is not intuitive at all.Subtemperate
That was not intuitive. Thanks so much. I was using openssl s_client -connect {SERVER:PORT} -showcerts > ~/calog.log as a substitute.Priestley
@RichardTopchiy Found a workaround, please see my latest edit to the answerAntennule
Works on Chrome version 73.0.3683.103 on macOS Mojave 10.14.4. Holding the 'options' key is the killer!Housecoat
You are a life saver! Worked like a charm on Chrome 75.0.3770.142 on Mac. Thanks!Michealmicheil
Works in Chrome 77. Note that dragging creates a .cer while Option+dragging creates a .txt (.pem) format.Guava
Who on Earth came up with this procedure? Can't software be more intuitive than this? (Worked for me after a few tries with Chrome 78.)Putter
I found the easiest way to do it was to export the certificate in firefox. Latests versions of chrome was useless :/Elwoodelwyn
Thank you, still works great on Chrome: 90.0.4430.85Prau
GUI that's more arcane than commandline. That's some serious high energy magic.Clientage
The steps in the comment are still working with Chrome 95 on MacOS 11. Agreed that dragging icon to Finder is not at all intuitive.Humbuggery
This is not working anymore in Version 105.0.5195.125 on MacOS :/Uniseptate
As of 107.0.5304.62, you can export certificates in an intuitive fashion from the certificate window. Click lock icon in address bar -> click "Connection is Secure" -> click "Certificate is valid" -> Details tab -> use "Export..." button at bottom.Antennule
@SimonZuckerbraun Do you still have an export button? Not seeing it today - I'm trying with this StackOverflow page. Update: Dragging the large certificate icon from Safari to Finder works! Does not work in Chrome.Feodor
@Feodor Yes, this is still working for me as described in my Oct. 27 note. Tested on Chrome for Mac 108.0.5359.124 (Official Build) (x86_64).Antennule
D
159

You should make flowing steps,

show certificate detail on chrome browser on macOS

domain-detail

drag big certificate icon on certificate detail window

certificate-detail

drop the icon to desktop and ta-ta! created the domain certificate .cer file on the desktop

certificate-on-desktop

Dietitian answered 24/12, 2019 at 8:50 Comment(4)
This works for me: drag big certificate icon on certificate detail window instead of the small icon on the top will save it locally.Opuscule
Wowwwww. Who knew? I didn't know that could be done, and was getting upset there was no obvious way to export certs. It seems it's more MacOS's fault than it is Chrome's (since it's the MacOS's native cert viewer).Bawdy
Unfortunately Drag-and-Drop into the Keychain Access App doesn't work. One really has to first drop it onto the Desktop.Salian
This is not working anymore in Version 105.0.5195.125 on MacOSUniseptate
C
30

As of Chrome 72 the certificate icon cannot be dragged/exported from Chrome as @RichardTopchiy stated in his comments.

However Safari does still allow the certificate icon to be dragged from the browser.

So the easiest way to export the certificate from Chrome is... to use a different browser to export the SSL certificate. Once the certificate is trusted, it will work on any browser on that device's user account. You're just using Safari to export the certificate easily.

Claudicant answered 1/3, 2019 at 11:15 Comment(8)
Fantastic "feature upgrade" there Google… :-(Cake
LOL. The irony. I dislike Chrome, but run Chromium; I grudgingly installed Chrome just to get this certificate drag feature, which no longer works! Didn't realise Safari works; will use that. Thanks!Recollection
Just tried it in chrome 75.0.3770.100, I was able to drag the large certificate icon to finder to export the cert.Spasmodic
It still works for me on Windows and Linux. Don't understand why it doesn't work on Mac the same way.Hassanhassell
Tried this on Safari 13.1.3 just now and it does not work. Thanks though.Ellaelladine
Gave up on chrome and tried this on Safari 15.3 and it works.Zachery
just type thisisunsafe and the page will load. this does not fix the problem for the certificate export but you can instantly access the page you want to accessUniseptate
Yes! This works as of today in Safari, not Chrome.Feodor
L
22

@Simon Zuckerbraun's answer is correct. My workaround is almost the same as Simon's. But don't need to use Text Editor, just drag the certificate to the Desktop Window then the certificate will be created immediately. Follow these steps :

  1. Open Google Chrome, go to the site.
  2. Click the icon to the left of the URL in the address bar.
  3. Click Certificate
  4. Arrange windows so that the Chrome window and the Desktop window are both visible.
  5. If you want to get a .cer certificate, drag from the large certificate icon to the desktop. If you want to get a .pem certificate, hold down option, and drag from the large certificate icon to the desktop.

Click here for more details

Letishaletitia answered 11/8, 2020 at 7:38 Comment(1)
Thanks. Not that anyone asked, but if you hold down cmd and drag and drop the certificate icon you get a .txt file containing all of the certificate detailsVaginitis
Y
11

I found a workaround and tested by Chrome Version 73.0.3683.103 (Official Build) (64-bit) on Macos 10.14.3.

When open the site with unsafe certificate, Chrome will show an error page 'Your connection is not private', follow the below steps:

  1. Click the text 'NET::ERR_CERT_AUTHORITY_INVALID', the content of the certificate will be shown.
  2. Copy the content from the line '-----BEGIN CERTIFICATE-----' to '-----END CERTIFICATE-----'.
  3. Paste them into a text editor, and save as a .crt file with plain text format.
  4. Import the .crt file into Keychain Access.
Yclept answered 5/4, 2019 at 5:22 Comment(2)
Here's a script to do the same thing. I've saved it as a bookmarklet until Google fix this. var element = document.createElement('a'); element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(document.getElementsByClassName('debugging-content')[9].innerText));element.setAttribute('download', location.host.replace(/[^\dA-Za-z]/g, '-') + '.crt');document.body.appendChild(element);element.click();document.body.removeChild(element);Lavonlavona
Thank you, that should have been obvious!Jeweljeweler
U
4

Just found out this does not work on Chrome Version 105.0.5195.125 on MacOS.

The certificate viewer looks like this now:

I haven't found a way how to save a certificate, but if you want to access the page just type the following while the focus is on the page:

  • thisisunsafe

and the page will load instantly.

found the information here: https://www.rffuste.com/tag/neterr_cert_invalid/

Uniseptate answered 26/9, 2022 at 15:30 Comment(2)
can be still done using firefox, see my commentContessacontest
jep but not in chrome. either you have to use firefox oder downgrade chrome on mac somehow or type thisisunsafe in chrome. im not aware of any other possible optionsUniseptate
C
1

You could use Firefox or Safari instead of Chrome.

Steps for Firefox

  1. Click the lock icon
  2. More information
  3. View Certificate
  4. In next screen each cert in chain can be exported as PEM

enter image description here

enter image description here

Contessacontest answered 30/9, 2022 at 8:56 Comment(2)
I cant find how to export the certificate. Can you describe about to how to export the certificate?Hushaby
Since Firefox 71 it's hidden as a link in the middle of the certificate view under Miscellaneous → Download → PEM (cert). See detailed steps hereScanties
R
-1

I was able to start it with --ignore-certificate-errors --incognito. Incognito so that it doesn't use any open sessions.

Reliable answered 9/4, 2019 at 21:25 Comment(0)
R
-4

New browsers process is different. Please follow the below steps Inspect the chrome browser-> You can find Security tab -> Click on the View Ceritificate button then i will open the popup Click on the details tab and press Copy to file button

Then press the buttton Next->Next->Browse->Save the file in your local directory. The file will save with .cer extension.

Renick answered 5/10, 2017 at 9:44 Comment(1)
He clearly asked for the Mac instructions and your screenshot is from windows.Tittup

© 2022 - 2024 — McMap. All rights reserved.