This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alexey.namyotkin
Recipients Jessica Ridgley, alexey.namyotkin, b.a.scott, dieresys, martin.panter, mbeachy, orsenthil, ronaldoussoren, tsujikawa, vzafzal, yan12125
Date 2020-08-02.19:06:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596395177.86.0.901225982397.issue7291@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-08-02 19:06:17alexey.namyotkinsetrecipients: + alexey.namyotkin, ronaldoussoren, orsenthil, mbeachy, dieresys, tsujikawa, b.a.scott, martin.panter, vzafzal, yan12125, Jessica Ridgley
2020-08-02 19:06:17alexey.namyotkinsetmessageid: <1596395177.86.0.901225982397.issue7291@roundup.psfhosted.org>
2020-08-02 19:06:17alexey.namyotkinlinkissue7291 messages
2020-08-02 19:06:17alexey.namyotkincreate