Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy authentication support #32

Open
GoogleCodeExporter opened this issue Mar 19, 2015 · 3 comments
Open

Proxy authentication support #32

GoogleCodeExporter opened this issue Mar 19, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Attempting to authenticate with a proxy server using NTLM

What is the expected output? What do you see instead?
Python-ntlm currently supports ntlm authentication via a proxy, but not 
authenticating with that proxy using ntlm.

What version of the product are you using? On what operating system?
Latest python-ntlm build, Python 2.7, any OS

Please provide any additional information below.
Included patch file adds support for ntlm proxy authentication.

Original issue reported on code.google.com by [email protected] on 21 Mar 2012 at 2:21

@GoogleCodeExporter
Copy link
Author

Uh, apologies, this probably shouldn't be marked as a defect; no idea how to 
change it, I'm afraid.

Original comment by [email protected] on 21 Mar 2012 at 2:21

@GoogleCodeExporter
Copy link
Author

Hi Chris. I too would like Pip and httpie and the rest to work behind ntlm 
proxies. How far did you get?

Follow https://github.com/shazow/urllib3/issues/242 for my [no]progress

Original comment by matt.hickford on 7 Sep 2013 at 10:01

@GoogleCodeExporter
Copy link
Author

There's a class ProxyNtlmAuthHandler in 
https://code.google.com/p/python-ntlm/source/browse/trunk/python26/ntlm/HTTPNtlm
AuthHandler.py that purports to do ntlm-authenticated proxying

    class ProxyNtlmAuthHandler(AbstractNtlmAuthHandler, urllib2.BaseHandler):
        """ 
            CAUTION: this class has NOT been tested at all!!! 
            use at your own risk
        """
        auth_header = 'Proxy-authorization'

        def http_error_407(self, req, fp, code, msg, headers):
            return self.http_error_authentication_required('proxy-authenticate', req, fp, headers)

But it's broken 

      File "C:\Python27\lib\site-packages\requests_ntlm-0.0.2.3-py2.7.egg\requests_ntlm\requests_ntlm.py", line 58, in retry_using_http_NTLM_auth
        ServerChallenge, NegotiateFlags = ntlm.parse_NTLM_CHALLENGE_MESSAGE(auth_header_value[5:])
      File "C:\Python27\lib\site-packages\python_ntlm-1.0.1-py2.7.egg\ntlm\ntlm.py", line 228, in parse_NTLM_CHALLENGE_MESSAGE
        TargetInfoLen = struct.unpack("<H",msg2[40:42])[0]
    struct.error: unpack requires a string argument of length 2

Perhaps the NTLM protocol is different for proxies? It looks like the challenge 
message is in an unexpected format

Original comment by matt.hickford on 23 Sep 2013 at 3:46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant