From e2501960d3db265dde85928a6ee977ab1461c783 Mon Sep 17 00:00:00 2001 From: Eli Shvartsman Date: Tue, 29 Apr 2014 15:54:11 +0300 Subject: [PATCH 1/2] init ProxyConfig.certstore with custom certs --- libmproxy/proxy/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmproxy/proxy/config.py b/libmproxy/proxy/config.py index 067c361d9..4ae93368a 100644 --- a/libmproxy/proxy/config.py +++ b/libmproxy/proxy/config.py @@ -25,6 +25,8 @@ class ProxyConfig: self.authenticator = authenticator self.confdir = os.path.expanduser(confdir) self.certstore = certutils.CertStore.from_store(self.confdir, CONF_BASENAME) + for spec, cert in certs: + self.certstore.add_cert_file(spec, cert) self.certforward = certforward From 1f29b16fb7fa190755dfcc363e4d3b4a73964b97 Mon Sep 17 00:00:00 2001 From: Eli Shvartsman Date: Tue, 29 Apr 2014 16:13:12 +0300 Subject: [PATCH 2/2] fix default certs --- libmproxy/proxy/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmproxy/proxy/config.py b/libmproxy/proxy/config.py index 4ae93368a..0a1345fa0 100644 --- a/libmproxy/proxy/config.py +++ b/libmproxy/proxy/config.py @@ -13,7 +13,7 @@ class ProxyConfig: def __init__(self, confdir=CONF_DIR, clientcerts=None, no_upstream_cert=False, body_size_limit=None, get_upstream_server=None, http_form_in="absolute", http_form_out="relative", authenticator=None, - ciphers=None, certs=None, certforward = False + ciphers=None, certs=[], certforward = False ): self.ciphers = ciphers self.clientcerts = clientcerts