Description: When attempting to use requests and requests-ntlm to authenticate to a server with a self-signed certificate, the verify=False kwarg is not honored.
Expected resuts: The certificate is not verified, and the request goes through.
Actual results: Requests attempts to verify the certificate, fails, and throws an SSLError.
DEBUG: 'kwargs' {'verify': False, 'allow_redirects': True, 'auth': <requests_ntlm.requests_ntlm.HttpNtlmAuth object at 0x292ff10>} /usr/lib/python2.7/site-packages/requests/api.py
DEBUG: 'verify' False /usr/lib/python2.7/site-packages/requests/adapters.py
DEBUG: 'kwargs' {} /usr/lib/python2.7/site-packages/requests_ntlm-0.0.2.3-py2.7.egg/requests_ntlm/requests_ntlm.py
DEBUG: 'args' {} /usr/lib/python2.7/site-packages/requests_ntlm-0.0.2.3-py2.7.egg/requests_ntlm/requests_ntlm.py
DEBUG: 'verify' True /usr/lib/python2.7/site-packages/requests/adapters.py
Traceback (most recent call last):
File "example.py", line 34, in <module>
main(sys.argv)
File "example.py", line 28, in main
auth=HttpNtlmAuth('DOMAIN\\%s' % username,'%s' % password))
File "/usr/lib/python2.7/site-packages/requests/api.py", line 56, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 279, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 374, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 220, in send
r = self.build_response(request, resp)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 113, in build_response
response = dispatch_hook('response', req.hooks, response)
File "/usr/lib/python2.7/site-packages/requests/hooks.py", line 39, in dispatch_hook
_hook_data = hook(hook_data)
File "/usr/lib/python2.7/site-packages/requests_ntlm-0.0.2.3-py2.7.egg/requests_ntlm/requests_ntlm.py", line 79, in response_hook
'Authorization', r, kwargs)
File "/usr/lib/python2.7/site-packages/requests_ntlm-0.0.2.3-py2.7.egg/requests_ntlm/requests_ntlm.py", line 49, in retry_using_http_NTLM_auth
response2 = self.adapter.send(request, **args_nostream)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 214, in send
raise SSLError(e)
requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
If the send() function in adapters.py is modified to set verify=False as the default option, example.py works as expected. Somewhere in there, the verify option is getting lost.