new: dev: use custom ca certs

This commit is contained in:
rachmadaniHaryono 2019-03-07 17:19:53 +08:00
parent 532cad6148
commit 367cf1c6eb

5
buku
View File

@ -2547,18 +2547,19 @@ class BukuDb:
if MYPROXY is None:
gen_headers()
ca_certs = os.getenv('BUKU_CA_CERTS', default=certifi.where())
if MYPROXY:
manager = urllib3.ProxyManager(
MYPROXY,
num_pools=1,
headers=MYHEADERS,
cert_reqs='CERT_REQUIRED',
ca_certs=certifi.where())
ca_certs=ca_certs)
else:
manager = urllib3.PoolManager(num_pools=1,
headers={'User-Agent': USER_AGENT},
cert_reqs='CERT_REQUIRED',
ca_certs=certifi.where())
ca_certs=ca_certs)
try:
r = manager.request(