mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
refactor: fixes for compat with latest certauth>=1.1.0
This commit is contained in:
parent
cda7705075
commit
dd30e3f2a7
@ -109,12 +109,12 @@ class ProxyRouter(object):
|
|||||||
|
|
||||||
# attempt to create the root_ca_file if doesn't exist
|
# attempt to create the root_ca_file if doesn't exist
|
||||||
# (generally recommended to create this seperately)
|
# (generally recommended to create this seperately)
|
||||||
certname = proxy_options.get('root_ca_name', self.CA_ROOT_NAME)
|
ca_name = proxy_options.get('root_ca_name', self.CA_ROOT_NAME)
|
||||||
CertificateAuthority.generate_ca_root(ca_file, certname)
|
|
||||||
|
|
||||||
certs_dir = proxy_options.get('certs_dir', self.CA_CERTS_DIR)
|
certs_dir = proxy_options.get('certs_dir', self.CA_CERTS_DIR)
|
||||||
self.ca = CertificateAuthority(ca_file=ca_file,
|
self.ca = CertificateAuthority(ca_file=ca_file,
|
||||||
certs_dir=certs_dir)
|
certs_dir=certs_dir,
|
||||||
|
ca_name=ca_name)
|
||||||
|
|
||||||
self.use_wildcard = proxy_options.get('use_wildcard_certs', True)
|
self.use_wildcard = proxy_options.get('use_wildcard_certs', True)
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ class ProxyRouter(object):
|
|||||||
hostname, port = env['REL_REQUEST_URI'].split(':')
|
hostname, port = env['REL_REQUEST_URI'].split(':')
|
||||||
|
|
||||||
if not self.use_wildcard:
|
if not self.use_wildcard:
|
||||||
_, certfile = self.ca.get_cert_for_host(hostname)
|
certfile = self.ca.get_cert_for_host(hostname)
|
||||||
else:
|
else:
|
||||||
certfile = self.ca.get_wildcard_cert(hostname)
|
certfile = self.ca.get_wildcard_cert(hostname)
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ sesh_key = None
|
|||||||
#=================================================================
|
#=================================================================
|
||||||
# Inited once per module
|
# Inited once per module
|
||||||
def setup_module():
|
def setup_module():
|
||||||
openssl_support = pytest.importorskip("OpenSSL")
|
certauth = pytest.importorskip("certauth")
|
||||||
|
|
||||||
def make_httpd(app):
|
def make_httpd(app):
|
||||||
return make_server('', 0, app)
|
return make_server('', 0, app)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user