Use OpenSSL-based images with custom CA certificates
In OpenSSL-based container images, such as curl and nginx, you can make your custom root Certificate Authority (CA) certificates available to the image. Your application can then establish secure TLS connections to services that use certificates signed by your company’s CA.
Replace system CA certificates in OpenSSL-based images by using Podman Copy linkLink copied!
Use the Podman volume mount option to override the image’s Certificate Authority (CA) bundle if you require only a custom certificate bundle in an OpenSSL-based image. The application in your image then uses only the custom bundle.
Before you begin Copy linkLink copied!
- The
podmanpackage is installed. - You have the CA certificate bundle in PEM format.
Procedure Copy linkLink copied!
$ podman run \
--rm \
--volume <path_to_certificate_bundle>.pem:/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:ro,Z \
registry.access.redhat.com/hi/<image>
This approach replaces the image’s built-in CA certificate bundle. If you require that your container trusts multiple CAs, ensure that all required CA certificates are part of the file that you mount to the container.
Replace system CA certificates by injecting the cluster-wide CA bundle in OpenSSL-based images on OpenShift Container Platform Copy linkLink copied!
If you require only a custom certificate bundle in an OpenSSL-based image, you can use an OpenShift Container Platform ConfigMap to override the image’s Certificate Authority (CA) bundle. The application in your image then uses only the custom bundle.
Before you begin Copy linkLink copied!
- You have access to OpenShift Container Platform CLI.
- The cluster administrator added the custom CA bundle to the cluster-wide proxy.
- You have the permissions to create ConfigMaps and modify Pod specifications in the target namespace.
Procedure Copy linkLink copied!
Replace system CA certificates by injecting a custom CA bundle in OpenSSL-based images on OpenShift Container Platform Copy linkLink copied!
If you require only a custom certificate bundle in an OpenSSL-based image, you can use an OpenShift Container Platform ConfigMap to override the image’s Certificate Authority (CA) bundle. The application in your image then uses only the custom bundle.
Before you begin Copy linkLink copied!
- You have access to OpenShift Container Platform CLI.
- You have the CA certificate bundle in PEM format.
- You have the permissions to create ConfigMaps and modify Pod specifications in the target namespace.
Procedure Copy linkLink copied!
Create a modified OpenSSL-based image to add custom root CA certificates Copy linkLink copied!
If you require that an OpenSSL-based image trusts both your custom Certificate Authorities (CAs) and the image’s built-in default CAs, create a modified image to add the custom certificates.
Before you begin Copy linkLink copied!
- The
podmanpackage is installed.