ensure binary read on windows

This commit is contained in:
Maximilian Hils 2013-12-10 03:13:37 +01:00
parent 2be19a5620
commit f0e96be142
1 changed files with 2 additions and 1 deletions

View File

@ -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: