Your IP : 18.220.134.161


Current Path : /opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyc

�
�Rec@@sOddlmZddlZddlZddlZddlZddlZddlmZm	Z
ddlZddlm
Z
ddlmZddlmZyddlZejZWn3eefk
r�dZdefd	��YZnXy
eZWn'ek
r d
efd��YZnXddlmZmZmZm Z dd
l!m"Z"m#Z#ddl$m%Z%m&Z&m'Z'm(Z(m)Z)ddl*m+Z+ddl,m-Z-ej.e/�Z0idd6dd6Z1ej2ddd�Z3ej4d�Z5de6fd��YZ7dee6fd��YZdefd��YZ8d�Z9esEe7Z8ne8Z:dS(i(tabsolute_importN(terrorttimeouti(tsix(tHTTPConnection(t
HTTPExceptiontBaseSSLErrorcB@seZRS((t__name__t
__module__(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyRstConnectionErrorcB@seZRS((RR(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyR	s(tNewConnectionErrortConnectTimeoutErrortSubjectAltNameWarningtSystemTimeWarning(tmatch_hostnametCertificateError(tresolve_cert_reqstresolve_ssl_versiontassert_fingerprinttcreate_urllib3_contexttssl_wrap_socket(t
connection(tHTTPHeaderDictiPthttpi�thttpsi�s[^-!#$%&'*+.^_`|~0-9a-zA-Z]tDummyConnectioncB@seZdZRS(s-Used to detect a failed ConnectionCls import.(RRt__doc__(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyRAsRcB@s�eZdZedZejejdfgZe	Z
d�Zed��Z
e
jd��Z
d�Zd�Zd�Zd	�Zddd
�ZRS(s$
    Based on httplib.HTTPConnection but provides an extra constructor
    backwards-compatibility layer between older and newer Pythons.

    Additional keyword parameters are used to configure attributes of the connection.
    Accepted parameters include:

      - ``strict``: See the documentation on :class:`urllib3.connectionpool.HTTPConnectionPool`
      - ``source_address``: Set the source address for the current connection.
      - ``socket_options``: Set specific options on the underlying socket. If not specified, then
        defaults are loaded from ``HTTPConnection.default_socket_options`` which includes disabling
        Nagle's algorithm (sets TCP_NODELAY to 1) unless the connection is behind a proxy.

        For example, if you wish to enable TCP Keep Alive in addition to the defaults,
        you might pass::

            HTTPConnection.default_socket_options + [
                (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
            ]

        Or you may want to disable the defaults by passing an empty list (e.g., ``[]``).
    RicO@s]tjs|jdd�n|jd�|_|jd|j�|_tj	|||�dS(Ntstricttsource_addresstsocket_options(
RtPY2tpoptNonetgetRtdefault_socket_optionsRt_HTTPConnectiont__init__(tselftargstkw((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyR$hs
	cC@s|jjd�S(s�
        Getter method to remove any trailing dots that indicate the hostname is an FQDN.

        In general, SSL certificates don't include the trailing dot indicating a
        fully-qualified domain name, and thus, they don't validate properly when
        checked against a domain name that includes the dot. In addition, some
        servers may not expect to receive the trailing dot when provided.

        However, the hostname with trailing dot is critical to DNS resolution; doing a
        lookup with the trailing dot will properly only resolve the appropriate FQDN,
        whereas a lookup without a trailing dot will search the system's search domain
        list. Thus, it's important to keep the original host around for use only in
        those cases where it's appropriate (i.e., when doing DNS lookup to establish the
        actual TCP connection across which we're going to send HTTP requests).
        t.(t	_dns_hosttrstrip(R%((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pythostuscC@s
||_dS(s�
        Setter for the `host` property.

        We assume that only urllib3 uses the _dns_host attribute; httplib itself
        only uses `host`, and it seems reasonable that other libraries follow suit.
        N(R)(R%tvalue((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyR+�scC@s�i}|jr|j|d<n|jr8|j|d<ny(tj|j|jf|j|�}WnUtk
r�t|d|j	|jf��n&t
k
r�}t|d|��nX|S(sp Establish a socket connection and set nodelay settings on it.

        :return: New socket connection.
        RRs0Connection to %s timed out. (connect timeout=%s)s(Failed to establish a new connection: %s(RRRtcreate_connectionR)tportRt
SocketTimeoutRR+tSocketErrorR
(R%textra_kwtconnte((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyt	_new_conn�s"		"
cC@s5||_t|dd�r1|j�d|_ndS(Nt_tunnel_hosti(tsocktgetattrR t_tunnelt	auto_open(R%R2((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyt
_prepare_conn�s	
cC@s|j�}|j|�dS(N(R4R:(R%R2((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pytconnect�scO@sMtj|�}|r4td||j�f��ntj|||||�S(sSend a request to the serversAMethod cannot contain non-token characters %r (found at least %r)(t_CONTAINS_CONTROL_CHAR_REtsearcht
ValueErrortgroupR#t
putrequest(R%tmethodturlR&tkwargstmatch((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyR@�scC@s�t|d
k	r|ni�}d|k}d|k}|j||d|d|�x*|j�D]\}}|j||�q_Wd|kr�|jdd�n|j�|d
k	rstjtf}	t	||	�r�|f}nx�|D]�}
|
s�q�nt	|
t�s|
j
d�}
ntt|
��d	}|j
|j
d
��|j
d�|j
|
�|j
d�q�Wn|j
d�d
S(s�
        Alternative to the common request method, which sends the
        body with chunked encoding and not as one block
        saccept-encodingR+tskip_accept_encodingt	skip_hoststransfer-encodingsTransfer-Encodingtchunkedtutf8isutf-8s
s0

N(RR R@titemst	putheadert
endheadersRtstring_typestbytest
isinstancetencodethextlentsend(R%RARBtbodytheadersRERFtheaderR,tstringish_typestchunktlen_str((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pytrequest_chunked�s2



N(RRRtport_by_schemetdefault_porttsockettIPPROTO_TCPtTCP_NODELAYR"tFalsetis_verifiedR$tpropertyR+tsetterR4R:R;R@R RY(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyRGs
	

					tHTTPSConnectionc
B@s�eZedZdZdZdZdZdZ	dZ
dddddejddd�Z
dddddddddd�	Zd�ZRS(Rc
	K@s\tj|||d|d||
�||_||_||_||_|	|_d|_dS(NRRR(RR$tkey_filet	cert_filetkey_passwordtssl_contexttserver_hostnamet	_protocol(R%R+R.RdReRfRRRgRhR'((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyR$�s"					c

C@s�|dkr9|jdk	r*|jj}q9td�}n||_||_||_||_||_||_	|o�t
jj|�|_
|o�t
jj|�|_|	|_dS(sX
        This method should only be called once, before the connection is used.
        N(R Rgtverify_modeRRdRet	cert_reqsRftassert_hostnameRtostpatht
expandusertca_certstca_cert_dirtca_cert_data(
R%RdReRkRfRpRlRRqRr((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pytset_certs						cC@s{|j�}|j}t|dd�rO||_|j�d|_|j}n|}|jdk	rp|j}nt	j
j�tk}|r�t
jdjt�t�nt}|jdkr�t}tdt|j�dt|j��|_n|j}t|j�|_|jrJ|jrJ|jrJ|rJt|d�rJ|j�ntd|d|j d	|j!d
|j"d|jd|jd
|jd|d|�	|_|j#r�t#|jj$dt�|j#�n�|jt%j&krSt|dt�rS|j'tk	rS|jj$�}|j(dd�s:t
jdj|�t)�nt*||j'pL|�n|jt%j+kpq|j#dk	|_,dS(NR5isWSystem time is way off (before {0}). This will probably lead to SSL verification errorstssl_versionRktload_default_certsR6tkeyfiletcertfileRfRpRqRrRhRgtbinary_formtcheck_hostnametsubjectAltNames�Certificate for {0} has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/urllib3/urllib3/issues/497 for details.)((-R4R+R7R R6R8R9R5RhtdatetimetdatettodaytRECENT_DATEtwarningstwarntformatR
R_RgtTrueRRRtRRkRjRpRqRrthasattrRuRRdReRfRtgetpeercerttsslt	CERT_NONERlR!Rt_match_hostnamet
CERT_REQUIREDR`(R%R2thostnameRhtis_time_offtdefault_ssl_contexttcontexttcert((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyR;2sn		
	
	



							
N(RRRZR[R RkRpRqRrRtRR\t_GLOBAL_DEFAULT_TIMEOUTR$RsR;(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyRc�s2
cC@sJyt||�Wn2tk
rE}tjd||�||_�nXdS(Ns@Certificate did not match expected hostname: %s. Certificate: %s(RRtlogtwarningt
_peer_cert(R�tasserted_hostnameR3((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyR��s	(;t
__future__RtreR{tloggingRmR\RR0RR/RtpackagesRtpackages.six.moves.http_clientRR#RR�tSSLErrorRtImportErrortAttributeErrorR t
BaseExceptionR	t	NameErrort	Exceptiont
exceptionsR
RRR
tpackages.ssl_match_hostnameRRt	util.ssl_RRRRRtutilRt_collectionsRt	getLoggerRR�RZR|R~tcompileR<tobjectRRcR�tVerifiedHTTPSConnection(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.pyt<module>sH


"(	��		

?>