diff options
author | Samoilenko Roman <ttahabatt@gmail.com> | 2018-01-08 00:05:39 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2018-01-07 23:05:39 +0100 |
commit | 821d76df02f70ccca5623cbc65d02b80e3998704 (patch) | |
tree | ab2a699972d07562a443f49f75876f60c8fa60eb | |
parent | 15f525e86bc4dbbf031439098b753f2ee3c98479 (diff) | |
download | mitmproxy-821d76df02f70ccca5623cbc65d02b80e3998704.tar.gz mitmproxy-821d76df02f70ccca5623cbc65d02b80e3998704.tar.bz2 mitmproxy-821d76df02f70ccca5623cbc65d02b80e3998704.zip |
Fix #2767 (#2770)
-rw-r--r-- | mitmproxy/addons/proxyauth.py | 8 | ||||
-rw-r--r-- | test/mitmproxy/addons/test_proxyauth.py | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/mitmproxy/addons/proxyauth.py b/mitmproxy/addons/proxyauth.py index 64233e88..dc99d5cc 100644 --- a/mitmproxy/addons/proxyauth.py +++ b/mitmproxy/addons/proxyauth.py @@ -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": diff --git a/test/mitmproxy/addons/test_proxyauth.py b/test/mitmproxy/addons/test_proxyauth.py index 1d05e137..97259d1c 100644 --- a/test/mitmproxy/addons/test_proxyauth.py +++ b/test/mitmproxy/addons/test_proxyauth.py @@ -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): |