Check a few more locations for CA certificates
This commit is contained in:
parent
5966f04656
commit
cc96cb1c75
12
__main__.py
12
__main__.py
@ -128,12 +128,18 @@ def setup_openssl_environment() -> None:
|
|||||||
# their NIH SSL library instead of OpenSSL.
|
# their NIH SSL library instead of OpenSSL.
|
||||||
if 'SSL_CERT_FILE' in os.environ or 'SSL_CERT_DIR' in os.environ:
|
if 'SSL_CERT_FILE' in os.environ or 'SSL_CERT_DIR' in os.environ:
|
||||||
return
|
return
|
||||||
candidates = ['/etc/pki/tls/certs/ca-bundle.crt']
|
candidates = [
|
||||||
|
'/etc/ssl/certs/ca-certificates.crt', # Debian/Ubuntu/Arch/Gentoo etc.
|
||||||
|
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" # RHEL 7
|
||||||
|
'/etc/pki/tls/certs/ca-bundle.crt', # Fedora/RHEL 6
|
||||||
|
'/etc/ssl/ca-bundle.pem', # OpenSUSE
|
||||||
|
"/etc/pki/tls/cacert.pem", # OpenELEC
|
||||||
|
]
|
||||||
ext_dir = getattr(sys, 'kitty_extensions_dir', '')
|
ext_dir = getattr(sys, 'kitty_extensions_dir', '')
|
||||||
if ext_dir:
|
if ext_dir:
|
||||||
if 'darwin' in sys.platform.lower():
|
|
||||||
d = os.path.dirname
|
d = os.path.dirname
|
||||||
candidates.append(os.path.join(d(d(d(ext_dir))), 'cacert.pem'))
|
if 'darwin' in sys.platform.lower():
|
||||||
|
candidates.insert(0, os.path.join(d(d(d(ext_dir))), 'cacert.pem'))
|
||||||
for q in candidates:
|
for q in candidates:
|
||||||
if os.access(q, os.R_OK):
|
if os.access(q, os.R_OK):
|
||||||
os.environ['SSL_CERT_FILE'] = q
|
os.environ['SSL_CERT_FILE'] = q
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user