Skip to content

Instantly share code, notes, and snippets.

@mhutter
Last active August 29, 2015 14:03
Show Gist options
  • Save mhutter/f39013a53e84de7de153 to your computer and use it in GitHub Desktop.
Save mhutter/f39013a53e84de7de153 to your computer and use it in GitHub Desktop.
Install own CA-Certificate in Linux
# Step 0: Convert the Certificate to PEM format
$ openssl x509 -inform der -in certificate.cer -out certificate.pem
# Step 0.5: Make sure there is only 1 Certificate in the File
$ grep 'BEGIN.* CERTIFICATE' certificate.pem | wc -l # should output `1`
# Step 1: Verify it's the correct Certificate
$ openssl x509 -noout -fingerprint -in certificate.pem
# Step 2: Copy the File to /etc/ssl/certs
# Do I really have to explain that? If you can't do that on your own you
# probably shouldn't be installing CA-Certificates anyway...
# Step 3: Find out the Hash of your Cert
$ openssl x509 -noout -hash -in certificate.pem
# Step 4: Inside /etc/ssl/certs, link your certificate to "hash.0"
$ ln -s certificate.pem `openssl x509 -hash -noout -in certificate.pem`.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment