From 21e7f420d2870d89ebc05181c1fca674d80e4e7c Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 30 Aug 2015 03:23:57 +0200 Subject: [PATCH] minor fixes --- libmproxy/main.py | 6 +++--- libmproxy/protocol2/tls.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libmproxy/main.py b/libmproxy/main.py index 4dd6fdb1e..faef8c82d 100644 --- a/libmproxy/main.py +++ b/libmproxy/main.py @@ -2,11 +2,11 @@ from __future__ import print_function, absolute_import import os import signal import sys -import netlib.version from netlib.version_check import check_pyopenssl_version, check_mitmproxy_version from . import version, cmdline -from .proxy import process_proxy_options, ProxyServerError +from .exceptions import ServerException from .proxy.server import DummyServer, ProxyServer +from .proxy.config import process_proxy_options def assert_utf8_env(): @@ -31,7 +31,7 @@ def get_server(dummy_server, options): else: try: return ProxyServer(options) - except ProxyServerError as v: + except ServerException as v: print(str(v), file=sys.stderr) sys.exit(1) diff --git a/libmproxy/protocol2/tls.py b/libmproxy/protocol2/tls.py index 041adaaab..73bb12f36 100644 --- a/libmproxy/protocol2/tls.py +++ b/libmproxy/protocol2/tls.py @@ -66,7 +66,8 @@ class TlsLayer(Layer): self._client_tls and self._server_tls and not self.config.no_upstream_cert ) - self._parse_client_hello() + if self._client_tls: + self._parse_client_hello() if client_tls_requires_server_cert: self._establish_tls_with_client_and_server()