Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/urllib3/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/urllib3/__pycache__/connection.cpython-310.pyc
o

�gI�	@sddlmZddlZddlZddlZddlZddlZddlZddlmZ	ddlm
ZddlZddl
mZddl
mZddlmZz	ddlZejZWneefy^dZGd	d
�d
e�ZYnwzeZWneytGdd�de�ZYnwzeZWney�Gd
d�de�ZYnwddlmZddlm Z ddl!m"Z"m#Z#m$Z$m%Z%ddl&m'Z'm(Z(ddl)m*Z*m+Z+m,Z,ddl-m.Z.m/Z/m0Z0m1Z1m2Z2e�3e4�Z5ddd�Z6e�7ddd�Z8e�9d�Z:Gdd�dee;�ZGdd�de�Z<dd �Z=d!d"�Z>Gd#d$�d$e;�Z?es�e?Z<e<Z@dS)%�)�absolute_importN)�error)�timeout)�HTTPConnection)�
HTTPException�)�create_proxy_ssl_contextc@�eZdZdS)�BaseSSLErrorN��__name__�
__module__�__qualname__�rr�4/usr/lib/python3/dist-packages/urllib3/connection.pyr
�r
c@r	)�ConnectionErrorNrrrrrr!rrc@r	)�BrokenPipeErrorNrrrrrr*rr)�HTTPHeaderDict��__version__)�ConnectTimeoutError�NewConnectionError�SubjectAltNameWarning�SystemTimeWarning)�CertificateError�match_hostname)�SKIP_HEADER�SKIPPABLE_HEADERS�
connection)�assert_fingerprint�create_urllib3_context�resolve_cert_reqs�resolve_ssl_version�ssl_wrap_socket�Pi�)�http�httpsi��z[^-!#$%&'*+.^_`|~0-9a-zA-Z]cs�eZdZdZedZejejdfgZ	dZ
dd�Zedd��Z
e
jd	d��Z
d
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zd�fdd�	Zddd�Z�ZS)ra5
    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., ``[]``).
    r&rFcOsftjs	|�dd�|�d�|_|�d|j�|_|�dd�|_|�dd�|_t	j
|g|�Ri|��dS)N�strict�source_address�socket_options�proxy�proxy_config)�six�PY2�pop�getr*�default_socket_optionsr+r,r-�_HTTPConnection�__init__)�self�args�kwrrrr4ns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�r5rrr�hostszHTTPConnection.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)r9)r5�valuerrrr<�s
c
Cs�i}|jr
|j|d<|jr|j|d<ztj|j|jf|jfi|��}W|Sty6t|d|j	|jf��t
yH}zt|d|��d}~ww)zoEstablish 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+r�create_connectionr9�portr�
SocketTimeoutrr<�SocketErrorr)r5�extra_kw�conn�errr�	_new_conn�s2

���
�����zHTTPConnection._new_conncCst|dd�S)N�_tunnel_host)�getattrr;rrr�_is_using_tunnel�szHTTPConnection._is_using_tunnelcCs$||_|��r|��d|_dSdS)Nr)�sockrH�_tunnel�	auto_open�r5rCrrr�
_prepare_conn�s

�zHTTPConnection._prepare_conncCs|��}|�|�dS�N)rErMrLrrr�connect�szHTTPConnection.connectcOs>t�|�}|rtd||��f��tj|||g|�Ri|��S)� zAMethod cannot contain non-token characters %r (found at least %r))�_CONTAINS_CONTROL_CHAR_RE�search�
ValueError�groupr3�
putrequest)r5�method�urlr6�kwargs�matchrrrrU�s

��zHTTPConnection.putrequestcGs`tdd�|D��stj||g|�R�dSt�|���tvr.tdd�t	t
jtt���f��dS)rPcss"�|]}t|t�o|tkVqdSrN)�
isinstance�strr)�.0�vrrr�	<genexpr>�s� z+HTTPConnection.putheader.<locals>.<genexpr>z+urllib3.util.SKIP_HEADER only supports '%s'z', 'N)
�anyr3�	putheaderr.�
ensure_str�lowerrrS�join�mapr[�title�sorted)r5�header�valuesrrrr`�s���zHTTPConnection.putheaderNcsN|duri}n|��}ddd�|D�vrt�|d<tt|�j||||d�dS)N�
user-agentcss�|]
}t�|���VqdSrN�r.rarb�r\�krrrr^�s�z)HTTPConnection.request.<locals>.<genexpr>�
User-Agent)�body�headers)�copy�_get_default_user_agent�superr�request)r5rVrWrnro��	__class__rrrs�s
zHTTPConnection.requestcCs$|pi}tdd�|D��}d|v}d|v}|j||||d�d|vr)|�dt��|��D]
\}}	|�||	�q-d|vrB|�d	d
�|��|dur�tjtf}
t	||
�rX|f}|D]0}|s_qZt	|t�si|�
d�}tt|��d
d�}t
|�
��}
|
d7}
|
|7}
|
d7}
|�|
�qZ|�d�dS)z�
        Alternative to the common request method, which sends the
        body with chunked encoding and not as one block
        cSsg|]	}t�|����qSrrjrkrrr�
<listcomp>�sz2HTTPConnection.request_chunked.<locals>.<listcomp>zaccept-encodingr<)�skip_accept_encoding�	skip_hostrirmztransfer-encodingzTransfer-Encoding�chunkedN�utf8�s
s0

)�setrUr`rq�items�
endheadersr.�string_types�bytesrZ�encode�hex�len�	bytearray�send)r5rVrWrnro�header_keysrwrxrgr=�stringish_types�chunk�len_str�to_sendrrr�request_chunked�s<�


zHTTPConnection.request_chunked)NN)rr
r�__doc__�port_by_scheme�default_port�socket�IPPROTO_TCP�TCP_NODELAYr2�is_verifiedr4�propertyr<�setterrErHrMrOrUr`rsr��
__classcell__rrrtrrKs$

	


rc@s|eZdZdZedZdZdZdZdZ	dZ
dZdZddddde
jddfdd�Z									d
dd�Zd	d
�Zdd�ZdS)�HTTPSConnectionz�
    Many of the parameters to this constructor are passed to the underlying SSL
    socket by means of :py:func:`urllib3.util.ssl_wrap_socket`.
    r'NFc
KsDtj|||f||d�|
��||_||_||_||_|	|_d|_dS)N)r)rr')rr4�key_file�	cert_file�key_password�ssl_context�server_hostname�	_protocol)r5r<r?r�r�r�r)rr�r�r7rrrr4$s
zHTTPSConnection.__init__c

Csv|dur|jdur|jj}ntd�}||_||_||_||_||_||_|o+t	j
�|�|_|o4t	j
�|�|_
|	|_dS)zX
        This method should only be called once, before the connection is used.
        N)r��verify_moder"r�r��	cert_reqsr��assert_hostnamer �os�path�
expanduser�ca_certs�ca_cert_dir�ca_cert_data)
r5r�r�r�r�r�r�r r�r�rrr�set_cert>s


zHTTPSConnection.set_certc	Cs�|��}|j}d}|��r%|jr|�||�}d}||_|��d|_|j}|}|j	dur/|j	}t
j��t
k}|rAt�d�t
�t�d}|jdurWd}tt|j�t|j�d�|_|j}t|j�|_|jst|jst|jst|rtt|d�rt|��t||j|j |j!|j|j|j|||d�
|_|r�|jdur�t|jd�r�|j�"�d	vr�t�d
|j|j�"�ft#�|j$r�t$|jj%dd�|j$�n-|jt&j'kr�t(|dd�s�|j)dur�|j�%�}|�*d
d�s�t�d�|�t+�t,||j)p�|�|jt&j-kp�|j$du|_.dS)NFTrzWSystem time is way off (before {0}). This will probably lead to SSL verification errors)�ssl_versionr��load_default_certs)
rI�keyfile�certfiler�r�r�r�r�r��
tls_in_tls�version>�TLSv1.1�TLSv1z�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')�binary_form�check_hostname�subjectAltNamerz�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.))/rEr<rH�tls_in_tls_required�_connect_tls_proxyrIrJrKrFr��datetime�date�today�RECENT_DATE�warnings�warn�formatrr�r!r#r�r"r�r�r�r�r��hasattrr�r$r�r�r�r��DeprecationWarningr �getpeercert�ssl�	CERT_NONErGr�r1r�_match_hostname�
CERT_REQUIREDr�)	r5rC�hostnamer�r��is_time_off�default_ssl_context�context�certrrrrO_s�
�

��������

����
�

�	�zHTTPSConnection.connectcCsX|j}|j}|rt|||d�St|j|j|j|j|j�}d|_	t||j|j|j||d�S)zY
        Establish a TLS connection to the proxy using the provided SSL context.
        )rIr�r�T)rIr�r�r�r�r�)
r-r�r$rr�r�r�r�r�r�)r5r�rCr-r�rrrr��s0��
�z"HTTPSConnection._connect_tls_proxy)	NNNNNNNNN)rr
rr�r�r�r�r�r�r�r�r r�r��_GLOBAL_DEFAULT_TIMEOUTr4r�rOr�rrrrr�s>
�
�!xr�c
Cs@zt||�WdSty}zt�d||�||_�d}~ww)Nz@Certificate did not match expected hostname: %s. Certificate: %s)rr�log�warning�
_peer_cert)r��asserted_hostnamerDrrrr��s���r�cCsdtS)Nzpython-urllib3/%srrrrrrq
srqc@seZdZdZdS)�DummyConnectionz-Used to detect a failed ConnectionCls import.N)rr
rr�rrrrr�sr�)A�
__future__rr��loggingr��rer�r�rrArr@r.�six.moves.http_clientrr3r�
util.proxyrr��SSLErrorr
�ImportError�AttributeError�
BaseExceptionr�	NameError�	Exceptionr�_collectionsr�_versionr�
exceptionsrrrr�packages.ssl_match_hostnamerr�utilrrr�	util.ssl_r r!r"r#r$�	getLoggerrr�r�r�r��compilerQ�objectr�r�rqr��VerifiedHTTPSConnectionrrrr�<module>sd
���


Jk

Spamworldpro Mini