From c46e3f90bbc38080a41a278340aaad27d8881fd9 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 6 Aug 2015 11:09:01 +0200 Subject: apply fixes from proxy-refactor-cb branch --- libmproxy/protocol2/auto.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libmproxy/protocol2/auto.py') diff --git a/libmproxy/protocol2/auto.py b/libmproxy/protocol2/auto.py index a00f1f52..fc111758 100644 --- a/libmproxy/protocol2/auto.py +++ b/libmproxy/protocol2/auto.py @@ -1,4 +1,4 @@ -from __future__ import (absolute_import, print_function, division, unicode_literals) +from __future__ import (absolute_import, print_function, division) from .layer import Layer @@ -6,6 +6,8 @@ class AutoLayer(Layer): def __call__(self): d = self.client_conn.rfile.peek(1) + if not d: + return # TLS ClientHello magic, see http://www.moserware.com/2009/06/first-few-milliseconds-of-https.html#client-hello if d[0] == "\x16": layer = SslLayer(self, True, True) -- cgit v1.2.3