Outbound HTTPS Fails with certificate verify failed (Pro)

An outbound call from DefectDojo fails, and the error or the application log contains:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1085)

The full error from the HTTP client DefectDojo uses reads:

HTTPSConnectionPool(host='sso.example.internal', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1085)')))

The number after _ssl.c: depends on the image’s Python build. The text after certificate verify failed: names the reason, and the variants are covered under Other reasons in the same line.

On DefectDojo 3.4.100 and later, a single sign-on login that hits this error does not show the raw text. The login form shows:

Single sign-on could not verify the identity provider's certificate. Ask your administrator to check that DefectDojo trusts the certificate authority that issued it, and that the certificate is valid for the provider's address.

and the application log has a warning that starts with Social login could not verify the identity provider's TLS certificate.

Cause

The server DefectDojo called presents a certificate signed by a certificate authority (CA) that DefectDojo does not trust, almost always an internal or private CA. The containers have their own trust store, separate from the host’s, so a curl from the host that succeeds proves nothing about them.

Confirm

On Docker Compose, test from inside the application with the trust store it actually loaded:

sudo -E dojo-compose-cli certs test https://sso.example.internal/

A trust problem prints FAILED SSLError followed by the message above, then a trust store: line. If that line says no private CA bundle is loaded, certs/private/dojo-ca-bundle.crt is empty or the containers have not restarted since you added it. For a tool reached through a Connector, add --connectors before the URL. See Test an outbound connection with certs test.

Fix

Docker Compose: add the CA that signed the server’s certificate, restart, and test again:

sudo -E dojo-compose-cli certs add-ca --restart ca.pem
sudo -E dojo-compose-cli certs test https://sso.example.internal/

The test should now print OK and a status code. See Trust an internal CA with certs add-ca. With a CLI that has no certs commands, add the bundle by hand as described in Trusting an internal or private CA.

Kubernetes (Helm chart): store the CA in a ConfigMap in the release namespace and turn on the chart’s outbound CA trust:

kubectl create configmap dojopro-ca-certs -n <namespace> --from-file=ca.crt=./ca.pem
django:
  uwsgi:
    certificates:
      enabled: true
      configName: dojopro-ca-certs
      certFileName: ca.crt

The chart combines your CA with the public roots for every application pod and the initializer, and adds it to the Connectors trust as well. Apply the values with helm upgrade.

Do not turn certificate verification off to work around the error. Trust the CA instead.

Other reasons in the same line

With the Python and OpenSSL in the DefectDojo 3.4 and 3.5 images (Python 3.14, OpenSSL 3.5):

The line ends withMeaningFix
unable to get local issuer certificateThe CA that signed the server’s certificate is not trusted.Add that CA, as above.
self-signed certificateThe server presents a self-signed certificate, not one issued by a CA.Trust that certificate as a CA, or reissue it from your CA.
CA cert does not include key usage extensionYour CA is trusted, but its certificate has no keyUsage extension. Python 3.13 and later reject such a CA under strict X.509 checking, which the images use.Reissue the CA certificate with basicConstraints=critical,CA:TRUE and keyUsage=critical,keyCertSign,cRLSign, then trust the new one.
certificate has expiredThe server’s certificate, or a CA in its chain, has expired.Renew it on the server.
Hostname mismatch, certificate is not valid for '<host>'.The certificate does not name the address DefectDojo called.Reissue it with that name in its subject alternative names, or call the server by a name it holds.