diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-11-14 21:55:02 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-11-14 21:55:02 +0100 |
commit | d6bd1cb4a697f40b1143457fe08eaca309dd4478 (patch) | |
tree | 80a9d8afbb0f40b7954261d82cffe38c3f0ce781 /libmproxy | |
parent | 0d98b9dcc58f62c6fcb1ab597456b13a24ea88a3 (diff) | |
download | mitmproxy-d6bd1cb4a697f40b1143457fe08eaca309dd4478.tar.gz mitmproxy-d6bd1cb4a697f40b1143457fe08eaca309dd4478.tar.bz2 mitmproxy-d6bd1cb4a697f40b1143457fe08eaca309dd4478.zip |
fix HTTPS Proxy-Authentication, refs #824
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/protocol/http.py | 5 | ||||
-rw-r--r-- | libmproxy/proxy/config.py | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 8740927e..8d6a53c6 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -309,7 +309,10 @@ class HttpLayer(Layer): self.log("request", "debug", [repr(request)]) # Handle Proxy Authentication - if not self.authenticate(request): + # Proxy Authentication conceptually does not work in transparent mode. + # We catch this misconfiguration on startup. Here, we sort out requests + # after a successful CONNECT request (which do not need to be validated anymore) + if self.mode != "transparent" and not self.authenticate(request): return # Make sure that the incoming request matches our expectations diff --git a/libmproxy/proxy/config.py b/libmproxy/proxy/config.py index cd9eda5a..0b45d83e 100644 --- a/libmproxy/proxy/config.py +++ b/libmproxy/proxy/config.py @@ -141,6 +141,9 @@ def process_proxy_options(parser, options): if options.auth_nonanonymous or options.auth_singleuser or options.auth_htpasswd: + if options.transparent_proxy: + return parser.error("Proxy Authentication not supported in transparent mode.") + if options.socks_proxy: return parser.error( "Proxy Authentication not supported in SOCKS mode. " |