403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3.9/site-packages/urllib3/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.9/site-packages/urllib3/__pycache__/connection.cpython-39.pyc
a

�ji�8�	@s�ddlmZddlZddlZddlZddlZddlZddlmZm	Z
ddlZddlm
Z
ddlmZddlmZzddlZejZWn*eefy�dZGdd	�d	e�ZYn0zeZWn"ey�Gd
d�de�ZYn0ddlmZmZmZmZdd
l m!Z!m"Z"ddl#m$Z$m%Z%m&Z&m'Z'm(Z(ddl)m*Z*ddl+m,Z,e�-e.�Z/ddd�Z0e�1ddd�Z2e�3d�Z4Gdd�de5�Z6Gdd�dee5�ZGdd�de�Z7dd�Z8e�s�e6Z7e7Z9dS) �)�absolute_importN)�error�timeout�)�six)�HTTPConnection)�
HTTPExceptionc@seZdZdS)�BaseSSLErrorN��__name__�
__module__�__qualname__�rr�6/usr/lib/python3.9/site-packages/urllib3/connection.pyr	sr	c@seZdZdS)�ConnectionErrorNr
rrrrrsr)�NewConnectionError�ConnectTimeoutError�SubjectAltNameWarning�SystemTimeWarning)�match_hostname�CertificateError)�resolve_cert_reqs�resolve_ssl_version�assert_fingerprint�create_urllib3_context�ssl_wrap_socket)�
connection)�HTTPHeaderDict�Pi�)�http�httpsi���z[^-!#$%&'*+.^_`|~0-9a-zA-Z]c@seZdZdZdS)�DummyConnectionz-Used to detect a failed ConnectionCls import.N)rrr
�__doc__rrrrr#Asr#c@sxeZdZdZedZejejdfgZ	dZ
dd�Zedd��Z
e
jd	d��Z
d
d�Zdd
�Zdd�Zdd�Zddd�ZdS)ra$
    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., ``[]``).
    rrFcOsJtjs|�dd�|�d�|_|�d|j�|_tj|g|�Ri|��dS)N�strict�source_address�socket_options)	rZPY2�pop�getr&�default_socket_optionsr'�_HTTPConnection�__init__)�self�args�kwrrrr,hs
zHTTPConnection.__init__cCs|j�d�S)a�
        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).
        �.)�	_dns_host�rstrip)r-rrr�hostuszHTTPConnection.hostcCs
||_dS)z�
        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)r1)r-�valuerrrr3�sc
Cs�i}|jr|j|d<|jr$|j|d<z"tj|j|jf|jfi|��}WnXtynt|d|j	|jf��Yn2t
y�}zt|d|��WYd}~n
d}~00|S)zp Establish a socket connection and set nodelay settings on it.

        :return: New socket connection.
        r&r'z0Connection to %s timed out. (connect timeout=%s)z(Failed to establish a new connection: %sN)r&r'rZcreate_connectionr1�portr�
SocketTimeoutrr3�SocketErrorr)r-Zextra_kw�conn�errr�	_new_conn�s.

��

���zHTTPConnection._new_conncCs$||_t|dd�r |��d|_dS)N�_tunnel_hostr)�sock�getattr�_tunnel�	auto_open�r-r8rrr�
_prepare_conn�szHTTPConnection._prepare_conncCs|��}|�|�dS)N)r:rAr@rrr�connect�szHTTPConnection.connectcOs>t�|�}|r"td||��f��tj|||g|�Ri|��S)zSend a request to the serverzAMethod cannot contain non-token characters %r (found at least %r))�_CONTAINS_CONTROL_CHAR_RE�search�
ValueError�groupr+�
putrequest)r-�method�urlr.�kwargs�matchrrrrG�s

��zHTTPConnection.putrequestNc
Cst|dur|ni�}d|v}d|v}|j||||d�|��D]\}}|�||�q>d|vrh|�dd�|��|dur�tjtf}	t||	�r�|f}|D]`}
|
s�q�t|
t�s�|
�	d�}
t
t|
��d	d�}t|�	��}|d
7}||
7}|d
7}|�
|�q�|�
d�dS)z�
        Alternative to the common request method, which sends the
        body with chunked encoding and not as one block
        Nzaccept-encodingr3)�skip_accept_encoding�	skip_hostztransfer-encodingzTransfer-EncodingZchunked�utf8�s
s0

)rrG�itemsZ	putheaderZ
endheadersrZstring_types�bytes�
isinstance�encode�hex�len�	bytearray�send)
r-rHrI�bodyZheadersrLrM�headerr4Zstringish_types�chunkZlen_strZto_sendrrr�request_chunked�s6�


zHTTPConnection.request_chunked)NN)rrr
r$�port_by_scheme�default_port�socketZIPPROTO_TCPZTCP_NODELAYr*�is_verifiedr,�propertyr3�setterr:rArBrGr[rrrrrGs


		rc	@sZeZdZedZdZdZdZdZdZ	dZ
dddddejddfdd�Z
d	dd�Zdd�ZdS)
�HTTPSConnectionr Nc
KsDtj|||f||d�|
��||_||_||_||_|	|_d|_dS)N)r%rr )rr,�key_file�	cert_file�key_password�ssl_context�server_hostnameZ	_protocol)r-r3r5rcrdrer%rrfrgr/rrrr,�szHTTPSConnection.__init__c

Csv|dur$|jdur|jj}ntd�}||_||_||_||_||_||_|oVt	j
�|�|_|oht	j
�|�|_
|	|_dS)zX
        This method should only be called once, before the connection is used.
        N)rf�verify_moderrcrd�	cert_reqsre�assert_hostnamer�os�path�
expanduser�ca_certs�ca_cert_dir�ca_cert_data)
r-rcrdrirernrjrrorprrr�set_certs

zHTTPSConnection.set_certcCs�|��}|j}t|dd�r4||_|��d|_|j}|}|jdurH|j}tj	�
�tk}|rlt�
d�t�t�d}|jdur�d}tt|j�t|j�d�|_|j}t|j�|_|js�|js�|js�|r�t|d�r�|��t||j|j|j|j|j|j||d�	|_|j �rt |jj!dd	�|j �nd|jt"j#k�r~t|d
d��s~|j$du�r~|j�!�}|�%dd��slt�
d
�|�t&�t'||j$�pz|�|jt"j(k�p�|j du|_)dS)Nr;rzWSystem time is way off (before {0}). This will probably lead to SSL verification errorsFT)�ssl_versionri�load_default_certs)	r<ZkeyfileZcertfilerernrorprgrf)Zbinary_formZcheck_hostnameZsubjectAltNamerz�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:r3r=r<r>r?r;rg�datetime�dateZtoday�RECENT_DATE�warnings�warn�formatrrfrrrrrrirhrnrorp�hasattrrsrrcrdrerZgetpeercert�sslZ	CERT_NONErjr)r�_match_hostnameZ
CERT_REQUIREDr_)r-r8�hostnamergZis_time_offZdefault_ssl_context�context�certrrrrB3s�
���

��������
�
��
��	�zHTTPSConnection.connect)	NNNNNNNNN)rrr
r\r]rirnrorprrrr^Z_GLOBAL_DEFAULT_TIMEOUTr,rqrBrrrrrb�s6�
�
!rbc
CsNzt||�Wn:tyH}z"t�d||�||_�WYd}~n
d}~00dS)Nz@Certificate did not match expected hostname: %s. Certificate: %s)rr�logZwarningZ
_peer_cert)rZasserted_hostnamer9rrrr|�s�r|):Z
__future__r�rertZloggingrkr^rr7rr6rwZpackagesrZpackages.six.moves.http_clientrr+rr{ZSSLErrorr	�ImportError�AttributeError�
BaseExceptionr�	NameError�	Exception�
exceptionsrrrrZpackages.ssl_match_hostnamerrZ	util.ssl_rrrrr�utilr�_collectionsrZ	getLoggerrr�r\rurv�compilerC�objectr#rbr|ZVerifiedHTTPSConnectionrrrr�<module>sL
	


((

Youez - 2016 - github.com/yon3zu
LinuXploit