mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-24 04:14:57 +08:00
fix HTTPS Proxy-Authentication, refs #824
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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. "
|
||||
|
||||
Reference in New Issue
Block a user