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!

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
kmiklas
  • 13,085
  • 22
  • 67
  • 103
  • To prevent scrolling: hold down option key & drag the certificate icon from the dialog into a texteditor. – dr jerry Mar 19 '21 at 08:59
  • For an up-to-date answer see [How to save SSL certificate by chrome and firefox on Mac?](https://stackoverflow.com/questions/65433919/how-to-save-ssl-certificate-by-chrome-and-firefox-on-mac/65435907#65435907) – cachius Apr 21 '23 at 13:11

9 Answers9

164

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.

Simon Zuckerbraun
  • 2,022
  • 1
  • 13
  • 7
  • This works on Chrome for Mac 54.0.2840.98 (64-bit). Thanks. – Boris Brudnoy Dec 21 '16 at 16:23
  • 3
    No longer there on 56.0.2924.87 (64-bit). :( Go to developer tools > security tab. But you still can't export it. – nomadic_squirrel Feb 09 '17 at 20:20
  • 26
    @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. – Simon Zuckerbraun Feb 10 '17 at 20:40
  • 10
    Dragging the large certificate icon to a Finder window is not intuitive at all. – MediumOne Jul 23 '18 at 09:19
  • That was not intuitive. Thanks so much. I was using openssl s_client -connect {SERVER:PORT} -showcerts > ~/calog.log as a substitute. – Eric Aldinger Jan 10 '19 at 00:45
  • @RichardTopchiy Found a workaround, please see my latest edit to the answer – Simon Zuckerbraun Apr 03 '19 at 20:05
  • 1
    Works on Chrome version 73.0.3683.103 on macOS Mojave 10.14.4. Holding the 'options' key is the killer! – Jijie Chen Apr 15 '19 at 02:16
  • 1
    You are a life saver! Worked like a charm on Chrome 75.0.3770.142 on Mac. Thanks! – BhathiyaW Jul 30 '19 at 23:11
  • Works in Chrome 77. Note that dragging creates a .cer while Option+dragging creates a .txt (.pem) format. – Dima Korobskiy Sep 25 '19 at 21:49
  • 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.) – Andriy Makukha Dec 02 '19 at 13:59
  • 1
    I found the easiest way to do it was to export the certificate in firefox. Latests versions of chrome was useless :/ – Ryan-Neal Mes Dec 21 '19 at 12:18
  • Thank you, still works great on Chrome: 90.0.4430.85 – house9 Apr 30 '21 at 16:05
  • GUI that's more arcane than commandline. That's some serious high energy magic. – Agent_L Sep 27 '21 at 08:01
  • 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. – Gravitoid Nov 03 '21 at 14:56
  • 5
    This is not working anymore in Version 105.0.5195.125 on MacOS :/ – Blueblazer172 Sep 19 '22 at 09:28
  • 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. – Simon Zuckerbraun Oct 27 '22 at 20:46
  • @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. – Amber Dec 19 '22 at 22:35
  • @Amber 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). – Simon Zuckerbraun Dec 21 '22 at 02:22
158

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

Yash Karanke
  • 764
  • 1
  • 15
  • 29
Ali K. Bagcioglu
  • 1,722
  • 1
  • 11
  • 8
  • 1
    This works for me: drag big certificate icon on certificate detail window instead of the small icon on the top will save it locally. – Jeffrey Jun 09 '20 at 15:39
  • 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). – SW_user2953243 Jun 17 '20 at 08:37
  • 2
    Unfortunately Drag-and-Drop into the Keychain Access App doesn't work. One really has to first drop it onto the Desktop. – asmaier Aug 21 '20 at 15:44
  • 5
    This is not working anymore in Version 105.0.5195.125 on MacOS – Blueblazer172 Sep 19 '22 at 09:29
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.

Gavin Kemp
  • 461
  • 6
  • 11
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

Rico Ardiansyah
  • 274
  • 2
  • 4
  • 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 details – james Mar 03 '22 at 15:00
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.
user2606091
  • 203
  • 4
  • 9
  • 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);` – adc May 04 '19 at 23:29
  • Thank you, that should have been obvious! – Yablargo Sep 27 '22 at 17:44
3

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/

Blueblazer172
  • 588
  • 2
  • 15
  • 44
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

cachius
  • 1,743
  • 1
  • 8
  • 21
Erkki Nokso-Koivisto
  • 1,203
  • 15
  • 19
  • 2
    I cant find how to export the certificate. Can you describe about to how to export the certificate? – Septian Dika Feb 20 '23 at 01:58
  • 1
    Since [Firefox 71](https://www.ghacks.net/2019/08/27/firefox-71-has-a-new-certificates-viewer/) it's hidden as a link in the middle of the certificate view under `Miscellaneous → Download → PEM (cert)`. See detailed steps [here](https://stackoverflow.com/questions/65433919/how-to-save-ssl-certificate-by-chrome-and-firefox-on-mac/65435907#65435907 "How to save SSL certificate by chrome and firefox on Mac?") – cachius Apr 05 '23 at 10:21
-1

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

-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.