diff options
Diffstat (limited to 'libmproxy/protocol2/auto.py')
-rw-r--r-- | libmproxy/protocol2/auto.py | 4 |
1 files changed, 3 insertions, 1 deletions
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) |