RedZddlmZddlZddlmZddlmZddlmZddl m Z ej d e ee ZGd d eZdS) z NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 )absolute_importN) getLogger)ntlm)HTTPSConnectionPool)HTTPSConnectiona#The 'urllib3.contrib.ntlmpool' module is deprecated and will be removed in urllib3 v2.0 release, urllib3 is not able to support it properly due to reasons listed in issue: https://github.com/urllib3/urllib3/issues/2282. If you are a user of this module please comment in the mentioned issue.cBeZdZdZdZfdZdZ d fd ZxZS) NTLMConnectionPoolzQ Implements an NTLM authentication version of an urllib3 connection pool httpsctt|j|i|||_||_|dd}|d|_|d|_||_ dS)z authurl is a random URL on the server that is protected by NTLM. user is the Windows user, probably in the DOMAIN\username format. pw is the password for the user. \rN) superr __init__authurlrawusersplitupperdomainuserpw)selfrrrargskwargs user_parts __class__s /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.pyrzNTLMConnectionPool.__init__"sv 1 $''0$A&AAA  ZZa((  m))++ qM c|xjdz c_td|j|j|jddi}d}d}t |j|j}dtj|j z||<td || d |jd|| }t| }td |j|jtd |td |dd|_||d}d}|D]} | dddkr | dd}|t'd|d||tj|\} } tj| |j|j|j| } d| z||<td || d |jd|| }td |j|jtd t| td |dd|jdkr9|jdkrt'dt'd|jd|jd|_td|S)Nrz3Starting NTLM HTTPS connection no. %d: https://%s%s Connection Keep-Alive Authorizationzwww-authenticate)hostportzNTLM %szRequest headers: %sGETzResponse status: %s %szResponse headers: %szResponse data: %s [...]dz, zNTLM z Unexpected z response header: iz3Server rejected request: wrong username or passwordzWrong server response:  zConnection established)num_connectionslogdebugr#rrr$rcreate_NTLM_NEGOTIATE_MESSAGErrequest getresponsedict getheadersstatusreasonreadfpr Exceptionparse_NTLM_CHALLENGE_MESSAGE create_NTLM_AUTHENTICATE_MESSAGErrr) rheaders req_header resp_headerconnresreshdrauth_header_valuesauth_header_valuesServerChallengeNegotiateFlagsauth_msgs r _new_connzNTLMConnectionPool._new_conn0s$ ! A  I L     .$ ( DIDI>>>($*L L+ +    '111 UDL$888  cnn&&'' *CJ CCC (&111 +SXXc]];;;$K066t<< # * *A!u$%abbE!  $)7B{{F;DWDWX  +/*K + + '8 TY TWn  ((2  '111 UDL$888   *CJ CCC ($s~~/?/?*@*@AAA +SXXZZ-=>>> :  zS   UVVV)cjjj#**UVV V *+++ rNTc r|i}d|d<tt||||||||S)Nr!r )rr urlopen) rmethodurlbodyr9retriesredirectassert_same_hostrs rrHzNTLMConnectionPool.urlopenssL ?G , '..66 Cw;K   r)NNrFTT) __name__ __module__ __qualname____doc__schemerrErH __classcell__)rs@rr r sF     AAAN          rr )rR __future__rwarningsloggingrrrpackages.six.moves.http_clientrwarnDeprecationWarningrOr+r rrr]s '&&&&&""""""<<<<<<  N ig g g g g ,g g g g g r