mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-02 00:05:27 +00:00
parent
15f525e86b
commit
821d76df02
@ -146,14 +146,14 @@ class ProxyAuth:
|
||||
)
|
||||
elif ctx.options.proxyauth.startswith("ldap"):
|
||||
parts = ctx.options.proxyauth.split(':')
|
||||
security = parts[0]
|
||||
ldap_server = parts[1]
|
||||
dn_baseauth = parts[2]
|
||||
password_baseauth = parts[3]
|
||||
if len(parts) != 5:
|
||||
raise exceptions.OptionsError(
|
||||
"Invalid ldap specification"
|
||||
)
|
||||
security = parts[0]
|
||||
ldap_server = parts[1]
|
||||
dn_baseauth = parts[2]
|
||||
password_baseauth = parts[3]
|
||||
if security == "ldaps":
|
||||
server = ldap3.Server(ldap_server, use_ssl=True)
|
||||
elif security == "ldap":
|
||||
|
@ -190,7 +190,7 @@ class TestProxyAuth:
|
||||
with pytest.raises(exceptions.OptionsError):
|
||||
ctx.configure(up, proxyauth="ldap:test:test:test")
|
||||
|
||||
with pytest.raises(IndexError):
|
||||
with pytest.raises(exceptions.OptionsError):
|
||||
ctx.configure(up, proxyauth="ldap:fake_serveruid=?dc=example,dc=com:person")
|
||||
|
||||
with pytest.raises(exceptions.OptionsError):
|
||||
|
Loading…
Reference in New Issue
Block a user