Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.117.73.46
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : ssl.cpython-32.pyo
l
��bc@s�dZddlZddlZddlZddlmZmZmZddlmZmZddlm	Z	m
Z
mZddlmZm
Z
mZmZddlmZmZmZddlmZmZmZmZmZmZmZmZmZdd	lmZdd
lmZmZmZddlm Z ide6d
e6de6Z!yddlm"Z"e"Z#Wne$k
r�e%Z#YnXde!e"<ddl&m'Z(ddl&m)Z*ddl&m&Z&m+Z+m,Z,ddl-Z-ddl.Z.ddl/Z/dZ0Gd�de1�Z2dd�Z3d�Z4Gd�de�Z5Gd�de&�Z6e%e%e7e	ee%e8e8e%d�	Z9d�Z:d Z;d!Z<d"�Z=d#�Z>ee%d$�Z?d%�Z@dS(&uThis module provides some more Pythonic support for SSL.

Object types:

  SSLSocket -- subtype of socket.socket which does SSL over the socket

Exceptions:

  SSLError -- exception raised for I/O errors

Functions:

  cert_time_to_seconds -- convert time string used for certificate
                          notBefore and notAfter functions to integer
                          seconds past the Epoch (the time values
                          returned from time.time())

  fetch_server_certificate (HOST, PORT) -- fetch the certificate provided
                          by the server running on HOST at port PORT.  No
                          validation of the certificate is performed.

Integer constants:

SSL_ERROR_ZERO_RETURN
SSL_ERROR_WANT_READ
SSL_ERROR_WANT_WRITE
SSL_ERROR_WANT_X509_LOOKUP
SSL_ERROR_SYSCALL
SSL_ERROR_SSL
SSL_ERROR_WANT_CONNECT

SSL_ERROR_EOF
SSL_ERROR_INVALID_ERROR_CODE

The following group define certificate requirements that one side is
allowing/requiring from the other side:

CERT_NONE - no certificates from the other side are required (or will
            be looked at if provided)
CERT_OPTIONAL - certificates are not required, but if provided will be
                validated, and if validation fails, the connection will
                also fail
CERT_REQUIRED - certificates are required, and will be validated, and
                if validation fails, the connection will also fail

The following constants identify various SSL protocol variants:

PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_SSLv23
PROTOCOL_TLSv1
iN(uOPENSSL_VERSION_NUMBERuOPENSSL_VERSION_INFOuOPENSSL_VERSION(u_SSLContextuSSLError(u	CERT_NONEu
CERT_OPTIONALu
CERT_REQUIRED(uOP_ALLuOP_NO_SSLv2uOP_NO_SSLv3uOP_NO_TLSv1(uRAND_statusuRAND_egduRAND_add(	uSSL_ERROR_ZERO_RETURNuSSL_ERROR_WANT_READuSSL_ERROR_WANT_WRITEuSSL_ERROR_WANT_X509_LOOKUPuSSL_ERROR_SYSCALLu
SSL_ERROR_SSLuSSL_ERROR_WANT_CONNECTu
SSL_ERROR_EOFuSSL_ERROR_INVALID_ERROR_CODE(uHAS_SNI(uPROTOCOL_SSLv3uPROTOCOL_SSLv23uPROTOCOL_TLSv1(u_OPENSSL_API_VERSIONuTLSv1uSSLv23uSSLv3(uPROTOCOL_SSLv2uSSLv2(ugetnameinfo(uerror(usocketuAF_INETuSOCK_STREAMu)DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2cBs|EeZdS(N(u__name__u
__module__(u
__locals__((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuCertificateErrorks
uCertificateErroricCs�g}x�|jd�D]x}|jd�|krJtdt|���n|dkrf|jd�qtj|�}|j|jdd��qWtjddj	|�d	tj
�S(
Nu.u*u,too many wildcards in certificate DNS name: u[^.]+u\*u[^.]*u\Au\.u\Z(usplitucountuCertificateErrorurepruappendureuescapeureplaceucompileujoinu
IGNORECASE(udnu
max_wildcardsupatsufrag((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu_dnsname_to_patoscCsg|std��ng}|jdd
�}xI|D]A\}}|dkr4t|�j|�redS|j|�q4q4W|s�xi|jdd�D]R}xI|D]A\}}|dkr�t|�j|�r�dS|j|�q�q�Wq�Wnt|�dkr(td|d	jtt	|��f��n;t|�dkrWtd
||df��ntd��dS(u#Verify that *cert* (in decoded format as returned by
    SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 rules
    are mostly followed, but IP addresses are not accepted for *hostname*.

    CertificateError is raised on failure. On success, the function
    returns nothing.
    uempty or no certificateusubjectAltNameuDNSNusubjectu
commonNameiu&hostname %r doesn't match either of %su, uhostname %r doesn't match %riu=no appropriate commonName or subjectAltName fields were found(((
u
ValueErrorugetu_dnsname_to_patumatchuappendulenuCertificateErrorujoinumapurepr(ucertuhostnameudnsnamesusanukeyuvalueusub((u*/usr/local/python-3.2/lib/python3.2/ssl.pyumatch_hostname�s.%cBsA|EeZdZdZd�Zd�Zddddd�Z	dS(	u|An SSLContext holds various SSL-related configuration options and
    data, such as certificates and possibly a private key.uprotocolcOs2tj||�}|tkr.|jt�n|S(N(u_SSLContextu__new__u_SSLv2_IF_EXISTSuset_ciphersu_DEFAULT_CIPHERS(uclsuprotocoluargsukwargsuself((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu__new__�scCs
||_dS(N(uprotocol(uselfuprotocol((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu__init__�sc
Cs+td|d|d|d|d|d|�S(Nusockuserver_sideudo_handshake_on_connectusuppress_ragged_eofsuserver_hostnameu_context(u	SSLSocket(uselfusockuserver_sideudo_handshake_on_connectusuppress_ragged_eofsuserver_hostname((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuwrap_socket�s
N(uprotocolFT(
u__name__u
__module__u__doc__u	__slots__u__new__u__init__uFalseuTrueuNoneuwrap_socket(u
__locals__((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu
SSLContext�s
		u
SSLContextcBsL|EeZdZddddeeddee	ddddddd�Z
d�Zdd�Zddd�Z
d�Zdd�Zd�Zdd	�Zdd
�Zdd�Zddd
�Zddd�Zddd�Zddd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Z d�Z!dS(u�This class implements a subtype of socket.socket that wraps
    the underlying OS socket in an SSL context when necessary, and
    provides read and write methods over that channel.ic"Cs�|r||_n�|r.|r.td��n|rJ|rJtd��n|r`|r`|}nt|�|_||j_|r�|jj|�n|r�|jj||�n|r�|jj|�n||_||_||_	||_
||_||_|r|rtd��n||_
||_||_|
|_d
}|dk	r�tj|d|jd|jd|jd|j��|j|j��y|j�Wn=tk
r�}z|jtjkr��nWYdd}~XnXd}|j �nA|dk	rtj|d|�ntj|d|	d|
d|�d
|_!d|_"||_#|r�yY|jj$|||�|_"|r�|j�}|dkr�td	��n|j%�nWq�tk
r�}z|j&�|�WYdd}~Xq�XndS(Nu5certfile must be specified for server-side operationsucertfile must be specifiedu4server_hostname can only be specified in client modeufamilyutypeuprotoufilenoguHdo_handshake_on_connect should not be specified for non-blocking socketsFT('ucontextu
ValueErroru
SSLContextuverify_modeuload_verify_locationsuload_cert_chainuset_ciphersukeyfileucertfileu	cert_reqsussl_versionuca_certsuciphersuserver_sideuserver_hostnameudo_handshake_on_connectusuppress_ragged_eofsuFalseuNoneusocketu__init__ufamilyutypeuprotoufilenou
settimeoutu
gettimeoutugetpeernameusocket_erroruerrnouENOTCONNuTrueudetachu_closedu_sslobju
_connectedu_wrap_socketudo_handshakeuclose(uselfusockukeyfileucertfileuserver_sideu	cert_reqsussl_versionuca_certsudo_handshake_on_connectufamilyutypeuprotoufilenousuppress_ragged_eofsuciphersuserver_hostnameu_contextu	connectedueutimeoutux((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu__init__�sz	


														

			
cCstd|jj��dS(NuCan't dup() %s instances(uNotImplementedu	__class__u__name__(uself((u*/usr/local/python-3.2/lib/python3.2/ssl.pyudupscCsdS(N((uselfumsg((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu_checkClosed!scCs�|j�yD|dk	r1|jj||�}n|jj|pCd�}|SWn[tk
r�}z;|jdtkr�|jr�|dk	r�dSdSn�WYdd}~XnXdS(uORead up to LEN bytes and return them.
        Return zero-length string on EOF.iisN(u_checkCloseduNoneu_sslobjureaduSSLErroruargsu
SSL_ERROR_EOFusuppress_ragged_eofs(uselfulenubufferuvux((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuread%s
cCs|j�|jj|�S(uhWrite DATA to the underlying SSL channel.  Returns
        number of bytes of DATA actually transmitted.(u_checkClosedu_sslobjuwrite(uselfudata((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuwrite9s
cCs|j�|jj|�S(u�Returns a formatted version of the data in the
        certificate provided by the other end of the SSL channel.
        Return None if no certificate was provided, {} if a
        certificate was provided, but not validated.(u_checkClosedu_sslobjupeer_certificate(uselfubinary_form((u*/usr/local/python-3.2/lib/python3.2/ssl.pyugetpeercert@s
cCs(|j�|jsdS|jj�SdS(N(u_checkClosedu_sslobjuNoneucipher(uself((u*/usr/local/python-3.2/lib/python3.2/ssl.pyucipherIs
	cCs�|j�|jr�|dkr5td|j��nx�y|jj|�}WnVtk
r�}z6|jdtkrzdS|jdtkr�dS�WYdd}~Xq8X|Sq8nt	j
|||�SdS(Niu3non-zero flags not allowed in calls to send() on %s(u_checkClosedu_sslobju
ValueErroru	__class__uwriteuSSLErroruargsuSSL_ERROR_WANT_READuSSL_ERROR_WANT_WRITEusocketusend(uselfudatauflagsuvux((u*/usr/local/python-3.2/lib/python3.2/ssl.pyusendPs"
	
cCsb|j�|jr)td|j��n5|dkrHtj|||�Stj||||�SdS(Nu%sendto not allowed on instances of %s(u_checkClosedu_sslobju
ValueErroru	__class__uNoneusocketusendto(uselfudatau
flags_or_addruaddr((u*/usr/local/python-3.2/lib/python3.2/ssl.pyusendtofs
	cCs�|j�|jr�|dkr5td|j��nt|�}d}x3||kr||j||d��}||7}qJW|Stj|||�SdS(Niu6non-zero flags not allowed in calls to sendall() on %s(u_checkClosedu_sslobju
ValueErroru	__class__ulenusendusocketusendall(uselfudatauflagsuamountucountuv((u*/usr/local/python-3.2/lib/python3.2/ssl.pyusendallps
	icCsY|j�|jrB|dkr5td|j��n|j|�Stj|||�SdS(Niu3non-zero flags not allowed in calls to recv() on %s(u_checkClosedu_sslobju
ValueErroru	__class__ureadusocketurecv(uselfubuflenuflags((u*/usr/local/python-3.2/lib/python3.2/ssl.pyurecv�s
	
cCs�|j�|r+|dkr+t|�}n|dkr@d}n|jr{|dkrktd|j��n|j||�Stj||||�SdS(Niiu8non-zero flags not allowed in calls to recv_into() on %s(	u_checkCloseduNoneulenu_sslobju
ValueErroru	__class__ureadusocketu	recv_into(uselfubufferunbytesuflags((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu	recv_into�s
		cCs@|j�|jr)td|j��ntj|||�SdS(Nu'recvfrom not allowed on instances of %s(u_checkClosedu_sslobju
ValueErroru	__class__usocketurecvfrom(uselfubuflenuflags((u*/usr/local/python-3.2/lib/python3.2/ssl.pyurecvfrom�s

	cCsC|j�|jr)td|j��ntj||||�SdS(Nu,recvfrom_into not allowed on instances of %s(u_checkClosedu_sslobju
ValueErroru	__class__usocketu
recvfrom_into(uselfubufferunbytesuflags((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu
recvfrom_into�s

	cCs(|j�|jr |jj�SdSdS(Ni(u_checkClosedu_sslobjupending(uself((u*/usr/local/python-3.2/lib/python3.2/ssl.pyupending�s
	
cCs'|j�d|_tj||�dS(N(u_checkCloseduNoneu_sslobjusocketushutdown(uselfuhow((u*/usr/local/python-3.2/lib/python3.2/ssl.pyushutdown�s
	cCs?|jr%|jj�}d|_|Stdt|���dS(NuNo SSL wrapper around (u_sslobjushutdownuNoneu
ValueErrorustr(uselfus((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuunwrap�s
		cCsd|_tj|�dS(N(uNoneu_sslobjusocketu_real_close(uself((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu_real_close�s	cCsT|j�}z3|dkr1|r1|jd�n|jj�Wd|j|�XdS(uPerform a TLS/SSL handshake.gN(u
gettimeoutu
settimeoutuNoneu_sslobjudo_handshake(uselfublockutimeout((u*/usr/local/python-3.2/lib/python3.2/ssl.pyudo_handshake�scCs�|jrtd��n|jr0td��n|jj|d|j�|_ya|rltj	||�}nd}tj||�|s�|jr�|j
�nd|_n|SWntk
r�d|_�YnXdS(Nu!can't connect in server-side modeu/attempt to connect already-connected SSLSocket!FT(userver_sideu
ValueErroru
_connecteducontextu_wrap_socketuFalseuserver_hostnameu_sslobjusocketu
connect_exuNoneuconnectudo_handshake_on_connectudo_handshakeuTrueusocket_error(uselfuaddru
connect_exurc((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu
_real_connect�s$			

	cCs|j|d�dS(uQConnects to remote ADDR, and then wraps the connection in
        an SSL channel.NF(u
_real_connectuFalse(uselfuaddr((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuconnect�scCs|j|d�S(uQConnects to remote ADDR, and then wraps the connection in
        an SSL channel.T(u
_real_connectuTrue(uselfuaddr((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu
connect_ex�scCsItj|�\}}|jj|d|jd|jdd�}||fS(u�Accepts a new connection from a remote client, and returns
        a tuple containing that new connection wrapped with a server-side
        SSL channel, and the address of the remote client.udo_handshake_on_connectusuppress_ragged_eofsuserver_sideT(usocketuacceptucontextuwrap_socketudo_handshake_on_connectusuppress_ragged_eofsuTrue(uselfunewsockuaddr((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuaccept�s			cCs|j�dS(N(u_real_close(uself((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu__del__�sNFT("u__name__u
__module__u__doc__uNoneuFalseu	CERT_NONEuPROTOCOL_SSLv23uTrueuAF_INETuSOCK_STREAMu__init__udupu_checkClosedureaduwriteugetpeercertucipherusendusendtousendallurecvu	recv_intourecvfromu
recvfrom_intoupendingushutdownuunwrapu_real_closeudo_handshakeu
_real_connectuconnectu
connect_exuacceptu__del__(u
__locals__((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu	SSLSocket�s@
	J				
								u	SSLSocketc

CsCtd|d|d|d|d|d|d|d|d	|d
|	�
S(Nusockukeyfileucertfileuserver_sideu	cert_reqsussl_versionuca_certsudo_handshake_on_connectusuppress_ragged_eofsuciphers(u	SSLSocket(
usockukeyfileucertfileuserver_sideu	cert_reqsussl_versionuca_certsudo_handshake_on_connectusuppress_ragged_eofsuciphers((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuwrap_socketscCs%ddl}|j|j|d��S(u�Takes a date-time string in standard ASN1_print form
    ("MON DAY 24HOUR:MINUTE:SEC YEAR TIMEZONE") and return
    a Python time value in seconds past the epoch.iNu%b %d %H:%M:%S %Y GMT(utimeumktimeustrptime(u	cert_timeutime((u*/usr/local/python-3.2/lib/python3.2/ssl.pyucert_time_to_secondssu-----BEGIN CERTIFICATE-----u-----END CERTIFICATE-----cCs?ttj|�dd�}tdtj|d�dtdS(u[Takes a certificate in binary DER format and returns the
    PEM version of it as a string.uASCIIustrictu
i@(ustrubase64ustandard_b64encodeu
PEM_HEADERutextwrapufillu
PEM_FOOTER(uder_cert_bytesuf((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuDER_cert_to_PEM_certscCs�|jt�s"tdt��n|j�jt�sJtdt��n|j�tt�tt��}tj|j	dd��S(uhTakes a certificate in ASCII PEM format and returns the
    DER-encoded version of it as a byte sequenceu(Invalid PEM encoding; must start with %su&Invalid PEM encoding; must end with %suASCIIustrict(
u
startswithu
PEM_HEADERu
ValueErrorustripuendswithu
PEM_FOOTERulenubase64udecodebytesuencode(upem_cert_stringud((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuPEM_cert_to_DER_cert#s

#cCsx|\}}|dk	r!t}nt}tt�d|d|d|�}|j|�|jd�}|j�t	|�S(u�Retrieve the certificate from the server at the specified address,
    and return it as a PEM-encoded string.
    If 'ca_certs' is specified, validate the server cert against it.
    If 'ssl_version' is specified, use it in the connection attempt.ussl_versionu	cert_reqsuca_certsNT(
uNoneu
CERT_REQUIREDu	CERT_NONEuwrap_socketusocketuconnectugetpeercertuTrueucloseuDER_cert_to_PEM_cert(uaddrussl_versionuca_certsuhostuportu	cert_reqsusudercert((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuget_server_certificate0s	

cCstj|d�S(Nu	<unknown>(u_PROTOCOL_NAMESuget(u
protocol_code((u*/usr/local/python-3.2/lib/python3.2/ssl.pyuget_protocol_nameBs(Au__doc__utextwrapureu_ssluOPENSSL_VERSION_NUMBERuOPENSSL_VERSION_INFOuOPENSSL_VERSIONu_SSLContextuSSLErroru	CERT_NONEu
CERT_OPTIONALu
CERT_REQUIREDuOP_ALLuOP_NO_SSLv2uOP_NO_SSLv3uOP_NO_TLSv1uRAND_statusuRAND_egduRAND_adduSSL_ERROR_ZERO_RETURNuSSL_ERROR_WANT_READuSSL_ERROR_WANT_WRITEuSSL_ERROR_WANT_X509_LOOKUPuSSL_ERROR_SYSCALLu
SSL_ERROR_SSLuSSL_ERROR_WANT_CONNECTu
SSL_ERROR_EOFuSSL_ERROR_INVALID_ERROR_CODEuHAS_SNIuPROTOCOL_SSLv3uPROTOCOL_SSLv23uPROTOCOL_TLSv1u_OPENSSL_API_VERSIONu_PROTOCOL_NAMESuPROTOCOL_SSLv2u_SSLv2_IF_EXISTSuImportErroruNoneusocketugetnameinfou_getnameinfouerrorusocket_erroruAF_INETuSOCK_STREAMubase64u	tracebackuerrnou_DEFAULT_CIPHERSu
ValueErroruCertificateErroru_dnsname_to_patumatch_hostnameu
SSLContextu	SSLSocketuFalseuTrueuwrap_socketucert_time_to_secondsu
PEM_HEADERu
PEM_FOOTERuDER_cert_to_PEM_certuPEM_cert_to_DER_certuget_server_certificateuget_protocol_name(((u*/usr/local/python-3.2/lib/python3.2/ssl.pyu<module>7s^"@



	)�:				

© 2025 GrazzMean