How to save an SSL certificate with a Mac

posted by 6 years ago and updated 5 years ago

Sometimes self-generated certificates from our development servers don't play as nice with our browser. So, we need to take a little extra time to configure them. We basically want to download, export the certificate and import it into your system. In order for the certificate to be trusted.

openssl s_client -connect server.com:443 -showcerts

# In case you don't have openssl install it with brew
# brew install openssl

At this point your terminal will spit out some lines with the certificates. Copy the text to text editor, including the --- Beginning and End --- and save the file as server.crt.

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

Import SSL to Keychain Access

Now, if you want to import and allow this certificate, you can double click the certificate. It will import it to your keychain with a red 'x'. You can right click the certificate in your Keychain, select Get Info and then click on Trust (with an arrow next to it). Finally, choose Always Trust under the When using this certificate.

Tags:

Do you need help? Sometimes it is just easier to ask

In case you need that little extra push with your project. We are always happy to collaborate with new people in the industry.

Contact us for help