Add GitHub SSL Certificate to Jenkins Keystore

You might run into trouble if your Jenkins instance has to connect to external TLS enabled endpoints which use self-signed certificates. You could either add the CA or the individual server certificate to your java trust store.

On RHEL systems this seems to be pretty straight forward (README below)

Download the server certificate with openssl to /etc/pki/ca-trust/source/anchors/

openssl s_client -connect server01.local:8281 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/pki/ca-trust/source/anchors/server01.pem

Regenerate the java truststore

run the command: update-ca-trust

README: /etc/pki/ca-trust/source/README

This directory /etc/pki/ca-trust/source/ contains CA certificates and
trust settings in the PEM file format. The trust settings found here will be
interpreted with a high priority - higher than the ones found in
/usr/share/pki/ca-trust-source/.

=============================================================================
QUICK HELP: To add a certificate in the simple PEM or DER file formats to the
            list of CAs trusted on the system:

            Copy it to the
                    /etc/pki/ca-trust/source/anchors/
            subdirectory, and run the
                    update-ca-trust
            command.

            If your certificate is in the extended BEGIN TRUSTED file format,
            then place it into the main source/ directory instead.
=============================================================================

Please refer to the update-ca-trust(8) manual page for additional information.

Leave a Reply

Your email address will not be published. Required fields are marked *