Alexey Namyotkin added the comment:
It has been 5 years, now the urllib3 is actively used, but it also inherited
this problem: if no authentication data has been received, then the method
_tunnel raises an exception OSError that does not contain response headers.
Accordingly, this exception cannot be handled. And perhaps this is an obstacle
to building a convenient system of authentication on a proxy server in a widely
used library requests (it would be nice to be able to just provide an argument
proxy_auth, similar to how it is done for server authorization). Now, if a user
wants to send a https request through a proxy that requires complex
authentication (Kerberos, NTLM, Digest, other) using the urllib3, he must first
send a separate request to the proxy, receive a response, extract the necessary
data to form the header Proxy-Authorization, then generate this header and pass
it to the ProxyManager. And if we are talking about Requests, then the
situation there is worse, because you cannot pass proxy headers directly
(https://github.com/psf/requests/issues/2708).
If we were to aim to simplify the authentication procedure on the proxy server
for the user, then where would we start, do we need to change the http.client
so that the error returned by the method _tunnel contains headers? Or maybe
it's not worth changing anything at all and the path with preliminary
preparation by user of the header Proxy-Authorization is the only correct one?
Martin Panter, could you also give your opinion? Thank you in advance.
--
___
Python tracker
<https://bugs.python.org/issue7291>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com