Error¶
Unable to get Local Issuer Certificate¶
The root certificates on the system are not working correctly, misconfigured, such as using a root ca cert that is not used to create the cert.
IT department installed a firewall which intercepts SSL connections.¶
https://serverfault.com/questions/1100480/wsl-docker-curl-60-unable-to-get-local-issuer-certificate
[SSL: CERTIFICATE_VERIFY_FAILED] unable to get local issuer certificate (_ssl.c:1108)¶
https://stackoverflow.com/questions/62952004/local-issuer-certificate-error-uniquely-in-docker-with-python
Solution: export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
Another case:\ https://levelup.gitconnected.com/solve-the-dreadful-certificate-issues-in-python-requests-module-2020d922c72f
The consolidate.pem should include all level crt files (root, intermediate, and local) in the chain
[SSL: CERTIFICATE_VERIFY_FAILED] unable to get local issuer certificate (_ssl.c:1129)¶
Cause: Could not find the root/intermediate ca crt files in the server
Possible solution:
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crtPossible solution, if we have both root and intermediate ca files, both ca crt files should be installed in the trust store
certificate verify failed: self signed certificate in certificate chain¶
Solution:
must put the server crt and the intermediate crt into one file
server crt first then intermediate crt:
cat server.crt intermediate-ca.crt > tls.crt
verify error:num=21:unable to verify the first certificate¶
https://pavolkutaj.medium.com/unable-to-verify-the-first-certificate-with-openssl-47eecb652a9b
This error means that the certificate chain is broken for OpenSSL — but does not have to be for browsers.
The crt is not added to /etc/ssl/certs/ca-certificates.crt
The pem converted from crt does not exist in /etc/ssl/certs
[SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled¶
disabled in OpenSSL 3: https://www.openssl.org/docs/manmaster/man7/migration_guide.html
https://pipeawk.com/index.php/2022/05/19/openssl-enable-legacy-renegotiation/
Cause: openssl binaries are compiled with legacy renegotiation disabled by default. This disables any non TLS 1.3 libraries and certificates renegotiation to a lower standard.
Solution: Update file /etc/ssl/openssl.cnf. Note: UnsafeLegacyRenegotiation (allows for man in the middle attacks) is a workaround, and should not be deployed to a production environment.
At the very beginning, insert
At the end, add
export OPENSSL_CONF=path_to_openssl.cnf
The previous solution might work
but we might not realise that there are other issues,
so we can get other errors like:
unable to get local issuer certificateit's possible the legacy checked first then check the local issuer certificate
Even for cert that is not self-siged, we need to add the root and intermediat certs. In dockerfile add: