From f0e96be142dc9c43deb174bcaffc4b83726bb9bc Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 10 Dec 2013 03:13:37 +0100 Subject: [PATCH] ensure binary read on windows --- libmproxy/proxy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index a62803fbf..7b2f9bfe0 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -302,7 +302,8 @@ class ProxyHandler(tcp.BaseHandler): def find_cert(self, cc, host, port, sni): if self.config.certfile: - return certutils.SSLCert.from_pem(file(self.config.certfile, "r").read()) + with open(self.config.certfile, "rb") as f: + return certutils.SSLCert.from_pem(f.read()) else: sans = [] if not self.config.no_upstream_cert: