Skip to content

Instantly share code, notes, and snippets.

@johnarok
Last active January 2, 2019 22:26
Show Gist options
  • Save johnarok/4a6de6b8bc7f8c7c2e249c495d5ba9b6 to your computer and use it in GitHub Desktop.
Save johnarok/4a6de6b8bc7f8c7c2e249c495d5ba9b6 to your computer and use it in GitHub Desktop.
certs-cheatsheet

Install CA root cert in Ubuntu

    sudo mkdir /usr/share/ca-certificates/extra
    sudo cp foo.crt /usr/share/ca-certificates/extra/foo.crt # Copy the CA .crt file to this directory:
    sudo update-ca-certificates --fresh # will add the .crt file's path to /etc/ca-certificates.conf
    sudo dpkg-reconfigure ca-certificates # for debug and ux

In case of a .pem file on Ubuntu, it must first be converted to a .crt file:

openssl x509 -in foo.pem -inform PEM -out foo.crt 

Get root certificates for a host

openssl s_client -host google.com -port 443 -prexit -showcerts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment