Fix #2087
This commit is contained in:
parent
d92f8a90ef
commit
54ad1d103a
@ -92,8 +92,10 @@ 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'
|
||||
sys.kitty_ssl_env_var = 'SSL_CERT_FILE'
|
||||
elif os.path.isdir('/etc/ssl/certs'):
|
||||
os.environ['SSL_CERT_DIR'] = '/etc/ssl/certs'
|
||||
sys.kitty_ssl_env_var = 'SSL_CERT_DIR'
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
|
||||
import fcntl
|
||||
import os
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
from contextlib import contextmanager
|
||||
from contextlib import suppress
|
||||
from contextlib import contextmanager, suppress
|
||||
|
||||
import kitty.fast_data_types as fast_data_types
|
||||
|
||||
@ -125,15 +125,24 @@ def remove_blocking(fd):
|
||||
os.set_blocking(fd, False)
|
||||
|
||||
|
||||
def process_env():
|
||||
ans = os.environ
|
||||
ssl_env_var = getattr(sys, 'kitty_ssl_env_var', None)
|
||||
if ssl_env_var is not None:
|
||||
ans = ans.copy()
|
||||
ans.pop(ssl_env_var, None)
|
||||
return ans
|
||||
|
||||
|
||||
def default_env():
|
||||
try:
|
||||
return default_env.env
|
||||
except AttributeError:
|
||||
return os.environ
|
||||
return process_env()
|
||||
|
||||
|
||||
def set_default_env(val=None):
|
||||
env = os.environ.copy()
|
||||
env = process_env().copy()
|
||||
if val:
|
||||
env.update(val)
|
||||
default_env.env = env
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user