Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /usr/local/lib/python3.6/site-packages/urllib3/util/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/python3.6/site-packages/urllib3/util/__pycache__/ssltransport.cpython-36.pyc
3

G�Kd��@sFddlZddlZddlZddlmZddlmZdZGdd�d�ZdS)�N�)�ProxySchemeUnsupported)�sixi@c@s�eZdZdZedd��Zd:dd�Zdd	�Zd
d�Zdd
�Z	d;dd�Z
d<dd�Zd=dd�Zd>dd�Z
d?dd�Zd@dd�Zdd�Zdd �ZdAd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdBd6d7�Zd8d9�ZdS)C�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�s"tjrtd��ntd��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
�</tmp/pip-build-8nxjc3nm/urllib3/urllib3/util/ssltransport.py�$_validate_ssl_context_for_tls_in_tlss

z1SSLTransport._validate_ssl_context_for_tls_in_tlsNTcCsHtj�|_tj�|_||_||_|j|j|j|d�|_|j|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)�selfrr	r
rr
r
r�__init__,s

zSSLTransport.__init__cCs|S)Nr
)rr
r
r�	__enter__?szSSLTransport.__enter__cGs|j�dS)N)�close)r�_r
r
r�__exit__BszSSLTransport.__exit__cCs
|jj�S)N)r�fileno)rr
r
rrEszSSLTransport.fileno�cCs|j||�S)N)�_wrap_ssl_read)r�len�bufferr
r
r�readHszSSLTransport.readrcCs|dkrtd��|j|�S)Nrz+non-zero flags not allowed in calls to recv)�
ValueErrorr)rr �flagsr
r
r�recvKszSSLTransport.recvcCs>|dkrtd��|r&|dkr&t|�}n|dkr2d}|j||�S)Nrz0non-zero flags not allowed in calls to recv_intoi)r#r r")rr!�nbytesr$r
r
r�	recv_intoPs
zSSLTransport.recv_intocCsr|dkrtd��d}t|��L}|jd��6}t|�}x&||krX|j||d��}||7}q4WWdQRXWdQRXdS)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
zSSLTransport.sendallcCs$|dkrtd��|j|jj|�}|S)Nrz+non-zero flags not allowed in calls to send)r#rr�write)rr,r$�responser
r
rr+cszSSLTransport.send�rc
Cst|�dddhks td|f��d|k}d|kp4|}|sB|sBt�d|k}d}	|rZ|	d7}	|rf|	d7}	tj||	�}
|jjd7_|dkr�d
}|dkr�tj}|dkr�|s�td	��|
S|r�|r�tj|
|
|�}n&|r�tj	|
|�}n|s�t�tj
|
|�}|�r�|Stj||||�}||_|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.
        r5�w�bz&invalid mode %r (only r, w, b allowed)��Nrz!unbuffered streams must be binary���)
�setr#�AssertionErrorr�SocketIO�_io_refs�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
rrE�	buffering�encoding�errors�newline�writing�reading�binary�rawmode�rawr!�textr
r
r�makefileis@
zSSLTransport.makefilecCs|j|jj�dS)N)rr�unwrap)rr
r
rrQ�szSSLTransport.unwrapcCs|jj�dS)N)rr)rr
r
rr�szSSLTransport.closeFcCs|jj|�S)N)r�getpeercert)r�binary_formr
r
rrR�szSSLTransport.getpeercertcCs
|jj�S)N)r�version)rr
r
rrT�szSSLTransport.versioncCs
|jj�S)N)r�cipher)rr
r
rrU�szSSLTransport.ciphercCs
|jj�S)N)r�selected_alpn_protocol)rr
r
rrV�sz#SSLTransport.selected_alpn_protocolcCs
|jj�S)N)r�selected_npn_protocol)rr
r
rrW�sz"SSLTransport.selected_npn_protocolcCs
|jj�S)N)r�shared_ciphers)rr
r
rrX�szSSLTransport.shared_cipherscCs
|jj�S)N)r�compression)rr
r
rrY�szSSLTransport.compressioncCs|jj|�dS)N)r�
settimeout)r�valuer
r
rrZ�szSSLTransport.settimeoutcCs
|jj�S)N)r�
gettimeout)rr
r
rr\�szSSLTransport.gettimeoutcCs|jj�dS)N)r�_decref_socketios)rr
r
rr]�szSSLTransport._decref_socketioscCsTy|j|jj||�Stjk
rN}z|jtjkr<|jr<dS�WYdd}~XnXdS)Nr)rrr"r�SSLError�errno�
SSL_ERROR_EOFr)rr r!�er
r
rr�szSSLTransport._wrap_ssl_readcGs�d}d}x�|r�d}y||�}Wn@tjk
r^}z"|jtjtjfkrH|�|j}WYdd}~XnX|jj�}|jj|�|dkr�d}q
|tjkr
|jj	t
�}|r�|jj|�q
|jj
�q
W|S)z>Performs an I/O loop between incoming/outgoing and the socket.TNF)rr^r_�SSL_ERROR_WANT_READ�SSL_ERROR_WANT_WRITErr"rr2r%�
SSL_BLOCKSIZErr3�	write_eof)r�func�argsZshould_loop�retr_ra�bufr
r
rr�s(

zSSLTransport._ssl_io_loop)NT)rN)rr)Nr)r)r)r5NNNN)F)N)�__name__�
__module__�__qualname__�__doc__�staticmethodrrrrrr"r%r'r2r+rPrQrrRrTrUrVrWrXrYrZr\r]rrr
r
r
rrs4	



	



,

	r)	r?rr�
exceptionsr�packagesrrdrr
r
r
r�<module>s

haha - 2025