[lug] self-signed ssl certs under CentOS

Lee Woodworth blug-mail at duboulder.com
Fri Jan 27 01:54:51 MST 2017

Don't know CentOS, but since I haven't seen anyone post instructions
I will suggest something to try.

Check that your cert and ca-bundle.crt are in the same format,
hopefully PEM:

  $ file /etc/ssl/certs/ca-certificates.crt
  /etc/ssl/certs/ca-certificates.crt: PEM certificate

  $ head /etc/ssl/certs/ca-certificates.crt

If your certs are in PEM format and a grep of /etc/pki/tls/certs/ca-bundle.crt
for text unique to your ca cert returns something, your ca cert may be getting
rejected for not being configured as a ca certificate**. You might look at
easy-rsa for setting up a private PKI that can generate CA, server and client
certs without too much work.

Otherwise concatenating your PEM encoded ca cert to ca-bundle.crt
might work.



** $ openssl x509 -in /etc/ssl/certs/ca-certificates.crt -noout -text
    X509v3 Basic Constraints: critical
    X509v3 Key Usage: critical
        Certificate Sign, CRL Sign

On 01/26/2017 04:13 PM, Michael J. Hammel wrote:
> Does anyone have a concise set of steps for dropping a self-signed cert
> in .pem format onto CentOS 7 so libCurl will use it?
> I've tried following the directions for update-ca-trust by dropping the
> file in the following directories, one at time
>    /etc/pki/ca-trust/source/anchors
>    /etc/pki/ca-trust/source/
>    /etc/pki/ca-trust/extracted/pem/
> And then running
>     update-ca-trust extract
> after each.  Then I run a C client that uses libCurl, but I always get
> this:
> * Initializing NSS with certpath: sql:/etc/pki/nssdb
> *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
>   CApath: none
> * Server certificate:
> *       subject: CN=xxx,OU=xxx,O=xxx,L=Colorado
> Springs,ST=Colorado,C=US
> *       start date: Jan 26 22:51:10 2017 GMT
> *       expire date: Jan 24 22:51:10 2027 GMT
> *       common name: xxx
> *       issuer: CN=xxx,OU=xxx,O=xxx,L=Colorado Springs,ST=Colorado,C=US
> * Issuer certificate is invalid.
> (xxx are redacted fields).  The same cert works on Debian, which has a
> much simpler process: just drop the file in /etc/ssl/certs.  Does a
> cert generated on Debian have to be regenerated on CentOS?   I didn't
> think so but who knows.

More information about the LUG mailing list