Skip to content

Instantly share code, notes, and snippets.

@identifysun
Created January 20, 2020 01:21
Show Gist options
  • Save identifysun/982fa42ca473a0408bb46d4a7b03187f to your computer and use it in GitHub Desktop.
Save identifysun/982fa42ca473a0408bb46d4a7b03187f to your computer and use it in GitHub Desktop.
CA certificate on linux

Centos 7

$ cp /root/<my-certification-file>.crt /etc/pki/ca-trust/source/anchors/
$ update-ca-trust

Ubuntu 14.04

$ cp /<my-certification-file>.crt /usr/local/share/ca-certificates/
$ mv /<my-certification-file>.crt /usr/share/ca-certificates/
$ update-ca-certificates --fresh

Alpine 3.6 (especially in docker you need to prepare for this)

$ cp /<my-certification-file>.crt /usr/local/share/ca-certificates/
$ mv /<my-certification-file>.crt /usr/share/ca-certificates/
$ update-ca-certificates --fresh

Same as Ubuntu but if you see the message below

“WARNING: ca-certificates.crt does not contain exactly one certificate or CRL: skipping”

Looks like it’s not done but it’s done.

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment