HEX
Server: Apache
System: Linux br384.hostgator.com.br 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User: regi8665 (2159)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python2.7/site-packages/urllib3/connection.pyc
�
i�$ec@@s�ddlmZddlZddlZddlZddlZddlZddlZddlmZ	ddlm
Zddlm
Z
ddlmZddlmZdd	lmZyddlZejZWn3eefk
rdZd
efd��YZnXy
eZWn'ek
r:defd
��YZnXy
eZWn'ek
rndefd��YZnXddlm Z ddl!m"Z"ddl#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)m*Z*m+Z+ddl,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2ddl3m4Z4m5Z5ej6e7�Z8idd6dd6Z9ej:ddd�Z;ej<d�Z=dee>fd��YZdefd��YZ?d �Z@d!�ZAd"e>fd#��YZBes�eBZ?ne?ZCdS($i(tabsolute_importN(terror(ttimeouti(tsix(tHTTPConnection(t
HTTPException(tcreate_proxy_ssl_contexttBaseSSLErrorcB@seZRS((t__name__t
__module__(((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyRstConnectionErrorcB@seZRS((RR	(((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyR
!stBrokenPipeErrorcB@seZRS((RR	(((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyR*s(tHTTPHeaderDict(t__version__(tConnectTimeoutErrortNewConnectionErrortSubjectAltNameWarningtSystemTimeWarning(tSKIP_HEADERtSKIPPABLE_HEADERSt
connection(tassert_fingerprinttcreate_urllib3_contexttis_ipaddresstresolve_cert_reqstresolve_ssl_versiontssl_wrap_socket(tCertificateErrortmatch_hostnameiPthttpi�thttpsi�s[^-!#$%&'*+.^_`|~0-9a-zA-Z]RcB@s�eZdZedZejejdfgZe	Z
dZd�Z
ed��Zejd��Zd�Zd�Zd�Zd	�Zd
�Zd�Zddd�Zddd
�ZRS(s5
    Based on :class:`http.client.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:

      .. code-block:: python

         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�|_|jdd�|_|jdd�|_	t
j|||�dS(Ntstricttsource_addresstsocket_optionstproxytproxy_config(RtPY2tpoptNonetgetR tdefault_socket_optionsR!R"R#t_HTTPConnectiont__init__(tselftargstkw((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyR*ss	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+((s6/usr/lib/python2.7/site-packages/urllib3/connection.pythost�scC@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((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyR1�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(soEstablish a socket connection and set nodelay settings on it.

        :return: New socket connection.
        R R!s0Connection to %s timed out. (connect timeout=%s)s(Failed to establish a new connection: %s(R R!Rtcreate_connectionR/tportRt
SocketTimeoutRR1tSocketErrorR(R+textra_kwtconnte((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyt	_new_conn�s"		"
cC@st|dd�S(Nt_tunnel_host(tgetattrR&(R+((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyt_is_using_tunnel�scC@s/||_|j�r+|j�d|_ndS(Ni(tsockR=t_tunnelt	auto_open(R+R8((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyt
_prepare_conn�s	
cC@s|j�}|j|�dS(N(R:RA(R+R8((s6/usr/lib/python2.7/site-packages/urllib3/connection.pytconnect�scO@sMtj|�}|r4td||j�f��ntj|||||�S(t sAMethod cannot contain non-token characters %r (found at least %r)(t_CONTAINS_CONTROL_CHAR_REtsearcht
ValueErrortgroupR)t
putrequest(R+tmethodturlR,tkwargstmatch((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyRH�scG@s|td�|D��s,tj|||�nLtj|j��tkrxtddjt	t
jtt���f��ndS(RCcs@s*|] }t|t�o!|tkVqdS(N(t
isinstancetstrR(t.0tv((s6/usr/lib/python2.7/site-packages/urllib3/connection.pys	<genexpr>�ss+urllib3.util.SKIP_HEADER only supports '%s's', 'N(
tanyR)t	putheaderRt
ensure_strtlowerRRFtjointmapRNttitletsorted(R+theadertvalues((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyRR�scC@s�t|dd�dk	r.|jj|j�n|dkrCi}n|j�}dd�|D�krut�|d<ntt|�j	||d|d|�dS(NR>s
user-agentcs@s$|]}tj|j��VqdS(N(RRSRT(ROtk((s6/usr/lib/python2.7/site-packages/urllib3/connection.pys	<genexpr>�ss
User-Agenttbodytheaders(
R<R&R>t
settimeoutRtcopyt_get_default_user_agenttsuperRtrequest(R+RIRJR\R]((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyRb�s	cC@s�|p	i}tg|D]}tj|j��^q�}d|k}d|k}|j||d|d|�d|kr�|jdt��nx*|j�D]\}	}
|j|	|
�q�Wd|kr�|jdd	�n|j�|dk	r�tj
tf}t||�r|f}nx�|D]�}|s6q$nt|t�sW|j
d
�}ntt|��d}
t|
j
��}|d7}||7}|d7}|j|�q$Wn|jd
�dS(s�
        Alternative to the common request method, which sends the
        body with chunked encoding and not as one block
        saccept-encodingR1tskip_accept_encodingt	skip_hosts
user-agents
User-Agentstransfer-encodingsTransfer-Encodingtchunkedtutf8is
s0

N(tsetRRSRTRHRRR`titemst
endheadersR&tstring_typestbytesRMtencodethextlent	bytearraytsend(R+RIRJR\R]R[theader_keysRcRdRYR2tstringish_typestchunktlen_strtto_send((s6/usr/lib/python2.7/site-packages/urllib3/connection.pytrequest_chunked�s:.




N(RR	t__doc__tport_by_schemetdefault_porttsockettIPPROTO_TCPtTCP_NODELAYR(tFalsetis_verifiedR&tproxy_is_verifiedR*tpropertyR1tsetterR:R=RARBRHRRRbRv(((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyRLs 
	
					
	
tHTTPSConnectionc
B@s�eZdZedZdZdZdZdZ	dZ
dZeZ
dddddejddd�Zdddddddddd�	Zd�Zd�ZRS(s�
    Many of the parameters to this constructor are passed to the underlying SSL
    socket by means of :py:func:`urllib3.util.ssl_wrap_socket`.
    Rc
	K@s\tj|||d|d||
�||_||_||_||_|	|_d|_dS(NRRR(RR*tkey_filet	cert_filetkey_passwordtssl_contexttserver_hostnamet	_protocol(R+R1R4R�R�R�RRR�R�R-((s6/usr/lib/python2.7/site-packages/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&R�tverify_modeRR�R�t	cert_reqsR�tassert_hostnameRtostpatht
expandusertca_certstca_cert_dirtca_cert_data(
R+R�R�R�R�R�R�RR�R�((s6/usr/lib/python2.7/site-packages/urllib3/connection.pytset_certHs						c	C@s|j�|_}|j}t}|j�rx|jrY|j||�|_}t}n|j�d|_	|j
}n|}|jdk	r�|j}nt
jj�tk}|r�tjdjt�t�nt}|jdkrt}tdt|j�dt|j��|_n|j}t|j�|_|jrs|jrs|jrs|rst|d�rs|j �nt!d|d|j"d|j#d	|j$d
|jd|jd|jd
|d|d|�
|_|r8|jdkr8t|jd�r8|jj%�ddhkr8tjd|j|jj%�ft&�n|j'rct'|jj(dt�|j'�n�|jt)j*kr�t+|dt�r�|j,tk	r�|jj(�}|j-dd�s�tjdj|�t.�nt/||j,p�|�n|jt)j0kp|j'dk	|_1dS(NisWSystem time is way off (before {0}). This will probably lead to SSL verification errorstssl_versionR�tload_default_certsR>tkeyfiletcertfileR�R�R�R�R�R�t
tls_in_tlstversiontTLSv1sTLSv1.1s�Negotiating TLSv1/TLSv1.1 by default is deprecated and will be disabled in urllib3 v2.0.0. Connecting to '%s' with '%s' can be enabled by explicitly opting-in with 'ssl_version'tbinary_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.)((2R:R>R1R}R=ttls_in_tls_requiredt_connect_tls_proxytTrueR?R@R;R�R&tdatetimetdatettodaytRECENT_DATEtwarningstwarntformatRR�RRR�RR�R�R�R�R�thasattrR�RR�R�R�R�tDeprecationWarningRtgetpeercerttsslt	CERT_NONER<R�R'Rt_match_hostnamet
CERT_REQUIREDR~(	R+R8thostnameR�R�tis_time_offtdefault_ssl_contexttcontexttcert((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyRBis�			
	
	



						
	
c
C@s|j}|j}|r1td|d|d|�St|j|j|j|j|j�}td|d|jd|jd|jd|d|�}|j	t
jkr�t|dt
�r�|j�}|jdd
�s�tjd	j|�t�nt||�n|j	t
jk|_|S(sY
        Establish a TLS connection to the proxy using the provided SSL context.
        R>R�R�R�R�R�R�R�s�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.)((R#R�RRR�R�R�R�R�R�R�R�R<R}R�R'R�R�R�RR�R�R(R+R�R8R#R�RzR�((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyR��s>						
N(RR	RwRxRyR&R�R�R�R�R�RR}R�Rzt_GLOBAL_DEFAULT_TIMEOUTR*R�RBR�(((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyR�s8
	vcC@sn|jd�}t|�r$|}nyt||�Wn2tk
ri}tjd||�||_�nXdS(Nsu[]s@Certificate did not match expected hostname: %s. Certificate: %s(tstripRRRtlogtwarningt
_peer_cert(R�tasserted_hostnametstripped_hostnameR9((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyR�s		cC@sdtS(Nspython-urllib3/%s(R
(((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyR`.stDummyConnectioncB@seZdZRS(s-Used to detect a failed ConnectionCls import.(RR	Rw(((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyR�2s(Dt
__future__RR�tloggingR�treRzR�RR6RR5tpackagesRtpackages.six.moves.http_clientRR)Rt
util.proxyRR�tSSLErrorRtImportErrortAttributeErrorR&t
BaseExceptionR
t	NameErrort	ExceptionRt_collectionsRt_versionR
t
exceptionsRRRRtutilRRRt	util.ssl_RRRRRRtutil.ssl_match_hostnameRRt	getLoggerRR�RxR�R�tcompileRDtobjectR�R�R`R�tVerifiedHTTPSConnection(((s6/usr/lib/python2.7/site-packages/urllib3/connection.pyt<module>sX




".��