Skip to Content
Linux Security Cookbook
book

Linux Security Cookbook

by Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
June 2003
Intermediate to advanced
336 pages
8h 54m
English
O'Reilly Media, Inc.
Content preview from Linux Security Cookbook

4.6. Installing a New SSL Certificate

Problem

You have a certificate that your SSL clients (mutt, openssl, etc.) cannot verify. It was issued by a Certifying Authority (CA) not included in your installed list of trusted issuers.

Solution

Add the CA’s root certificate to the list, together with any other, intermediate certificates you may need. First, ensure the certificates are in PEM format. [Recipe 4.10] A PEM format file looks like this:

-----BEGIN CERTIFICATE-----
MIID+DCCAuCgAwIBAgIRANAeQJAAACdLAAAAAQAAAAQwDQYJKoZIhvcNAQEFBQAw
gYwxCzAJBgNVBAYTAlVTMQ0wCwYDVQQIEwRVdGFoMRcwFQYDVQQHEw5TYWx0IExh
...
wo3CbezcE9NGxXl8
-----END CERTIFICATE-----

Then for Red Hat, simply add it to the file /usr/share/ssl/cert.pem.

Note that only the base64-encoded data between the BEGIN CERTIFICATE and END CERTIFICATE lines is needed. Everything else is ignored. The existing file includes a textual description of each certificate as well, which you can generate [Recipe 4.5] and include if you like.

For SuSE, supposing your CA certificate is in newca.pem, run:

# cp newca.pem /usr/share/ssl/certs
# /usr/bin/c_rehash

Discussion

Red Hat keeps certificates in a single file, whereas SuSE keeps them in a directory with a particular structure, a sort of hash table implemented using symbolic links. You can also use the hashed-directory approach with Red Hat if you like, since it includes the c_rehash program.

Many programs have their own certificate storage and do not use this system-wide list. Netscape and Mozilla ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Command Line

Mastering Linux Command Line

Coding Gears | Train Your Brain

Publisher Resources

ISBN: 0596003919Errata Page