LLI Wiki — My Digital Knowledge Base

Add a custom CA certificate on CentOS

Add an internal certificate authority to the CentOS trust store and test the HTTPS connection.

This article explains how to add an internal certificate authority (CA) to the system trust store on CentOS, then how to test the HTTPS connection.

Add the CA certificate

Copy the content of the CA certificate (PEM format) into a file in the anchors directory:

vi /etc/pki/ca-trust/source/anchors/ca.example.com.crt

Update the trust store

sudo update-ca-trust

Test the connection

curl 'https://app.example.com' -k
curl 'https://app.example.com'
curl 'https://app.example.com' --cacert /etc/pki/tls/certs/ca.example.com.crt

The first command skips certificate verification (-k). The next two perform it, the last one by explicitly pointing to the CA file.

Mastodon LLIMastodon SocialFosstodon