Workaround for usual Linux distro nonsense

Fedora 44 broke the long standing decade plus location of OpenSSL
certificates file. Fixes #2151819 [Download metadata not working](https://bugs.launchpad.net/calibre/+bug/2151819)
This commit is contained in:
Kovid Goyal
2026-05-08 11:19:58 +05:30
parent c6f6a170c4
commit 497d689d8a
+5
View File
@@ -25,6 +25,11 @@ def setup_openssl_environment():
if 'SSL_CERT_FILE' not in os.environ and 'SSL_CERT_DIR' not in os.environ:
if os.access('/etc/pki/tls/certs/ca-bundle.crt', os.R_OK):
os.environ['SSL_CERT_FILE'] = '/etc/pki/tls/certs/ca-bundle.crt'
# morons in Fedora removed the bundle file in Fedora 44.
# https://fedoraproject.org/wiki/Changes/droppingOfCertPemFile
# Hopefully there does not exist another distro that uses this dir for something else.
elif os.path.isdir('/etc/pki/tls/certs'):
os.environ['SSL_CERT_DIR'] = '/etc/pki/tls/certs'
elif os.path.isdir('/etc/ssl/certs'):
os.environ['SSL_CERT_DIR'] = '/etc/ssl/certs'