SSL_CERT_DIR and SSL_CERT_FILE openssl env variable on Linux

Viewed 3612

My Linux box has certificate in /etc/pki/tls/certs/ca-bundle.crt

I have installed miniconda and tried to use its urllib.request package.

import urllib.request
r = urllib.request("https://example.com")

according to openssl documentation, ca-bundle.crt file should be picked by openssl if i set the SSL_CERT_DIR to "/etc/pki/tls/certs". but instead i get error [SSL: CERTIFICATE_VERIFY_FAILED].

when i set the variable SSL_CERT_FILE to "/etc/pki/tls/certs/ca-bundle.crt" everything works fine.

why setting the SSl_CERT_DIR did not worked ? according to documentation it should work.

0 Answers
Related