404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.138.123.215: ~ $
�
h f���+@s�dZddlZddlZddlZddlZddlmZddlmZ	ddl
Z
ddl
mZmZm
Z
ddl
mZddl
mZmZmZmZmZmZddl
mZmZmZdd	l
mZmZdd
l
mZmZmZmZyddl
m Z Wne!k
r8YnXdd
�Z"e"d�e"d�e"d�e"d�e"d�ddl
m#Z#m$Z$m%Z%ddl
m&Z&e'e
d�e(�d<dd�e(�j)�D�Z*yddl
m+Z+e+Z,Wne!k
r	dZ,YnXde*e+<yddl
m-Z-m.Z.Wne!k
rBYnXde*e-<de*e.<ej/dkrddl
m0Z0m1Z1ndd l2m2Z2m3Z3m4Z4m5Z5dd!l2m6Z6m7Z7ddl8Z8ddl9Z9e:Z;e
j<r�d"gZ=ngZ=d#Z>d$Z?Gd%d&�d&e@�ZAd'd(d)�ZBd*d+�ZCed,d-�ZDd.d/�ZEGd0d1�d1ed1d2��ZFGd3d4�d4eFe	�ZGGd5d6�d6e�ZHeGjId7dd8dd9dd:d;�ZJeKd<dd=d>d?eGjId@ddAdd7dd8dd9ddBdC�ZLeJZMeLZNGdDdE�dEe2�ZOddd>eeKddFdFddGdH�	ZPdIdJ�ZQdKZRdLZSdMdN�ZTdOdP�ZUeKddQdR�ZVdSdT�ZWdS)Ua�
This 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_TLS
PROTOCOL_TLSv1
PROTOCOL_TLSv1_1
PROTOCOL_TLSv1_2

The following constants identify various SSL alert message descriptions as per
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6

ALERT_DESCRIPTION_CLOSE_NOTIFY
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
ALERT_DESCRIPTION_BAD_RECORD_MAC
ALERT_DESCRIPTION_RECORD_OVERFLOW
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
ALERT_DESCRIPTION_HANDSHAKE_FAILURE
ALERT_DESCRIPTION_BAD_CERTIFICATE
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
ALERT_DESCRIPTION_CERTIFICATE_REVOKED
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
ALERT_DESCRIPTION_ILLEGAL_PARAMETER
ALERT_DESCRIPTION_UNKNOWN_CA
ALERT_DESCRIPTION_ACCESS_DENIED
ALERT_DESCRIPTION_DECODE_ERROR
ALERT_DESCRIPTION_DECRYPT_ERROR
ALERT_DESCRIPTION_PROTOCOL_VERSION
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
ALERT_DESCRIPTION_INTERNAL_ERROR
ALERT_DESCRIPTION_USER_CANCELLED
ALERT_DESCRIPTION_NO_RENEGOTIATION
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
ALERT_DESCRIPTION_UNRECOGNIZED_NAME
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
�N)�
namedtuple)�Enum)�OPENSSL_VERSION_NUMBER�OPENSSL_VERSION_INFO�OPENSSL_VERSION)�_SSLContext)�SSLError�SSLZeroReturnError�SSLWantReadError�SSLWantWriteError�SSLSyscallError�SSLEOFError)�	CERT_NONE�
CERT_OPTIONAL�
CERT_REQUIRED)�txt2obj�nid2obj)�RAND_status�RAND_add�
RAND_bytes�RAND_pseudo_bytes)�RAND_egdcCsCx<tt�D].}|j|�r
tt|�t�|<q
q
WdS)N)�dir�_ssl�
startswith�getattr�globals)�prefix�n�r�(/opt/alt/python34/lib64/python3.4/ssl.py�_import_symbolsssr!ZOP_ZALERT_DESCRIPTION_Z
SSL_ERROR_�	PROTOCOL_ZVERIFY_)�HAS_SNI�HAS_ECDH�HAS_NPN)�_OPENSSL_API_VERSION�PROTOCOL_TLSZPROTOCOL_SSLv23cCs.i|]$\}}|jd�r||�qS)r")r)�.0�name�valuerrr �
<dictcomp>�s	r+)�PROTOCOL_SSLv2ZSSLv2)�PROTOCOL_TLSv1_1�PROTOCOL_TLSv1_2zTLSv1.1zTLSv1.2�win32)�enum_certificates�	enum_crls)�socket�AF_INET�SOCK_STREAM�create_connection)�
SOL_SOCKET�SO_TYPEz
tls-uniquez�ECDH+AESGCM:ECDH+CHACHA20:DH+AESGCM:DH+CHACHA20:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:DH+HIGH:RSA+AESGCM:RSA+AES:RSA+HIGH:!aNULL:!eNULL:!MD5:!3DESz�ECDH+AESGCM:ECDH+CHACHA20:DH+AESGCM:DH+CHACHA20:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:DH+HIGH:RSA+AESGCM:RSA+AES:RSA+HIGH:!aNULL:!eNULL:!MD5:!DSS:!RC4:!3DESc@seZdZdS)�CertificateErrorN)�__name__�
__module__�__qualname__rrrr r8�sr8�c	CsDg}|sdS|jd�^}}|jd�}||krYtdt|���n|su|j�|j�kS|dkr�|jd�nY|jd�s�|jd�r�|jtj|��n"|jtj|�j	dd��x$|D]}|jtj|��q�Wtj
d	d
j|�dtj�}|j
|�S)zhMatching according to RFC 6125, section 6.4.3

    http://tools.ietf.org/html/rfc6125#section-6.4.3
    F�.�*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)�split�countr8�repr�lower�appendr�re�escape�replace�compile�join�
IGNORECASE�match)	Zdn�hostnameZ
max_wildcardsZpatsZleftmostZ	remainderZ	wildcardsZfragZpatrrr �_dnsname_match�s&"
&rLcCs[|std��ng}|jdf�}xC|D];\}}|dkr4t||�r_dS|j|�q4q4W|s�xc|jdf�D]L}xC|D];\}}|dkr�t||�r�dS|j|�q�q�Wq�Wnt|�dkrtd|d	jtt|��f��n;t|�dkrKtd
||df��ntd��dS)
a)Verify that *cert* (in decoded format as returned by
    SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
    rules are followed, but IP addresses are not accepted for *hostname*.

    CertificateError is raised on failure. On success, the function
    returns nothing.
    ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDZsubjectAltNameZDNSNZsubjectZ
commonNamer<z&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)	�
ValueError�getrLrC�lenr8rH�maprA)�certrKZdnsnamesZsan�keyr*�subrrr �match_hostnames.%rT�DefaultVerifyPathszQcafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capathcCs�tj�}tjj|d|d�}tjj|d|d�}ttjj|�ra|ndtjj|�r||nd|�S)z/Return paths to default cafile and capath.
    rr<��N)	r�get_default_verify_paths�os�environrNrU�path�isfile�isdir)�parts�cafile�capathrrr rX0srXcs^eZdZdZfZ�fdd�Ze�fdd��Ze�fdd��Z�S)�_ASN1Objectz#ASN.1 object identifier lookup
    cst�j|t|dd��S)Nr)F)�super�__new__�_txt2obj)�cls�oid)�	__class__rr rcCsz_ASN1Object.__new__cst�j|t|��S)z3Create _ASN1Object from OpenSSL numeric ID
        )rbrc�_nid2obj)reZnid)rgrr �fromnidFsz_ASN1Object.fromnidcst�j|t|dd��S)z=Create _ASN1Object from short name, long name or OID
        r)T)rbrcrd)rer))rgrr �fromnameLsz_ASN1Object.fromname)	r9r:r;�__doc__�	__slots__rc�classmethodrirjrr)rgr ra>s
raznid shortname longname oidc@s"eZdZdZdZdZdS)�PurposezDSSLContext purpose flags with X509v3 Extended Key Usage objects
    z1.3.6.1.5.5.7.3.1z1.3.6.1.5.5.7.3.2N)r9r:r;rk�SERVER_AUTH�CLIENT_AUTHrrrr rnSsrnc@s�eZdZdZdZdZedd�Zedd	�Zd
dddd
d�Z	dd�Z
dd�Zej
dd�ZdS)�
SSLContextz|An SSLContext holds various SSL-related configuration options and
    data, such as certificates and possibly a private key.�protocol�__weakref__�CA�ROOTcOs2tj||�}|tkr.|jt�n|S)N)rrc�_SSLv2_IF_EXISTS�set_ciphers�_DEFAULT_CIPHERS)rerr�args�kwargs�selfrrr rcaszSSLContext.__new__cCs
||_dS)N)rr)r{rrrrr �__init__gszSSLContext.__init__FTNc
Cs+td|d|d|d|d|d|�S)N�sock�server_side�do_handshake_on_connect�suppress_ragged_eofs�server_hostname�_context)�	SSLSocket)r{r}r~rr�r�rrr �wrap_socketjs
zSSLContext.wrap_socketcCs�t�}xp|D]h}t|d�}t|�dksIt|�dkrXtd��n|jt|��|j|�qW|j|�dS)N�asciir�z(NPN protocols must be 1 to 255 in length)�	bytearray�bytesrOrrC�extendZ_set_npn_protocols)r{�
npn_protocolsZprotosrr�brrr �set_npn_protocolsts	
$zSSLContext.set_npn_protocolscCswt�}xWt|�D]I\}}}|dkr|dksL|j|kr_|j|�q_qqW|jd|�|S)NZx509_asnT�cadata)r�r0rfr��load_verify_locations)r{�	storename�purposeZcertsrQ�encodingZtrustrrr �_load_windows_store_certss	z$SSLContext._load_windows_store_certscCsbt|t�st|��ntjdkrTx$|jD]}|j||�q7Wn|j�dS)Nr/)�
isinstancera�	TypeError�sys�platform�_windows_cert_storesr�Zset_default_verify_paths)r{r�r�rrr �load_default_certs�szSSLContext.load_default_certs)zprotocolz__weakref__)rtru)r9r:r;rkrlr�r'rcr|r�r�r�rnror�rrrr rqZs
rqr_r`r�cCsBt|t�st|��ntt�}|jtO_|jtO_|jtt	dd�O_|t
jkr�t|_
d|_np|t
jkr�|jtt	dd�O_|jtt	dd�O_|jtt	dd�O_|jt�n|s	|s	|r|j|||�n|j
tkr>|j|�n|S)z�Create a SSLContext object with default settings.

    NOTE: The protocol and settings may change anytime without prior
          deprecation. The values represent a fair balance between maximum
          compatibility and security.
    ZOP_NO_COMPRESSIONrTZOP_CIPHER_SERVER_PREFERENCEZOP_SINGLE_DH_USEZOP_SINGLE_ECDH_USE)r�rar�rqr'�options�OP_NO_SSLv2�OP_NO_SSLv3rrrnror�verify_mode�check_hostnamerprw�_RESTRICTED_SERVER_CIPHERSr�rr�)r�r_r`r��contextrrr �create_default_context�s&	r��	cert_reqsr�Fr��certfile�keyfilec
Cs�t|t�st|��nt|�}	|	jtO_|	jtO_|dk	r`||	_n||	_|r�|r�t	d��n|s�|r�|	j
||�n|s�|s�|r�|	j|||�n|	jtkr�|	j
|�n|	S)a/Create a SSLContext object for Python stdlib modules

    All Python stdlib modules shall use this function to create SSLContext
    objects in order to keep common settings in one place. The configuration
    is less restrict than create_default_context()'s to increase backward
    compatibility.
    Nzcertfile must be specified)r�rar�rqr�r�r�r�r�rM�load_cert_chainr�rr�)
rrr�r�r�r�r�r_r`r�r�rrr �_create_unverified_context�s"	
r�c@seZdZdZddddeeddeeddddddddd�Ze	dd	��Z
e
jd
d	��Z
dd�Zdd
d�Z
dd�Zdddd�Zdd�Zddd�Zdd�Zdd�Zdd�Zddd�Zddd �Zd!d"�Zdd#d$�Zd%dd&d'�Zddd(d)�Zd%dd*d+�Zddd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"dd:d;�Z#d<d=�Z$d>d?�Z%d@dA�Z&dBdC�Z'dDdEdF�Z(dS)Gr�z�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.NFTrcCsD|r||_n|r.|r.td��n|rJ|rJtd��n|r`|r`|}nt|�|_||j_|r�|jj|�n|r�|jj||�n|r�|jj|�n|r�|jj|�n||_||_	||_
||_||_||_
|jtt�tkr?td��n|rZ|rZtd��n|jjr||r|td��n||_||_||_|
|_|dk	rtj|d|jd|jd|jd	|j��|j|j��|j �nA|dk	r"tj|d	|�ntj|d|	d|
d|�y|j!�WnCt"k
r�}z#|j#t#j$kr|�nd
}WYdd}~XnXd}d
|_%d|_&||_'|r@yY|jj(|||�|_&|r|j�}|dkrtd
��n|j)�nWq@t"tfk
r<|j*��Yq@XndS)Nz5certfile must be specified for server-side operationszcertfile must be specifiedz!only stream sockets are supportedz4server_hostname can only be specified in client modez'check_hostname requires server_hostname�family�type�proto�filenoFTgzHdo_handshake_on_connect should not be specified for non-blocking sockets)+r�rMrqr�r�r�r�rwr�r�r��ssl_version�ca_certs�ciphersZ
getsockoptr6r7r4�NotImplementedErrorr�r~r�rr�r2r|r�r�r�r��
settimeout�
gettimeout�detach�getpeername�OSError�errnoZENOTCONNZ_closed�_sslobj�
_connected�_wrap_socket�do_handshake�close)r{r}r�r�r~r�r�r�rr�r�r�r�r�r�r�r�r��eZ	connected�timeoutrrr r|�s�	


														

			
zSSLSocket.__init__cCs|jS)N)r�)r{rrr r�RszSSLSocket.contextcCs||_||j_dS)N)r�r�r�)r{Zctxrrr r�Vs	cCstd|jj��dS)NzCan't dup() %s instances)�NotImplementedrgr9)r{rrr �dup[sz
SSLSocket.dupcCsdS)Nr)r{�msgrrr �_checkClosed_szSSLSocket._checkClosedcCs|js|j�ndS)N)r�r�)r{rrr �_check_connectedcs	zSSLSocket._check_connectedcCs�|j�|js"td��nyD|dk	rI|jj||�}n|jj|p[d�}|SWn[tk
r�}z;|jdtkr�|jr�|dk	r�dSdSn�WYdd}~XnXdS)zORead up to LEN bytes and return them.
        Return zero-length string on EOF.z'Read on closed or unwrapped SSL socket.Nir�)r�r�rM�readrryZ
SSL_ERROR_EOFr�)r{rO�buffer�v�xrrr r�ks
	zSSLSocket.readcCs2|j�|js"td��n|jj|�S)zhWrite DATA to the underlying SSL channel.  Returns
        number of bytes of DATA actually transmitted.z(Write on closed or unwrapped SSL socket.)r�r�rM�write)r{�datarrr r��s
	zSSLSocket.writecCs$|j�|j�|jj|�S)z�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.)r�r�r�Zpeer_certificate)r{Zbinary_formrrr �getpeercert�s

zSSLSocket.getpeercertcCs3|j�|jstjr"dS|jj�SdS)N)r�r�rr%�selected_npn_protocol)r{rrr r��s
zSSLSocket.selected_npn_protocolcCs(|j�|jsdS|jj�SdS)N)r�r��cipher)r{rrr r��s
	zSSLSocket.ciphercCs(|j�|jsdS|jj�SdS)N)r�r��compression)r{rrr r��s
	zSSLSocket.compressioncCs�|j�|jr�|dkr5td|j��ny|jj|�}WnVtk
r�}z6|jdtkrwdS|jdtkr�dS�WYdd}~Xq�X|Snt	j
|||�SdS)Nrz3non-zero flags not allowed in calls to send() on %s)r�r�rMrgr�rryZSSL_ERROR_WANT_READZSSL_ERROR_WANT_WRITEr2�send)r{r��flagsr�r�rrr r��s 
	zSSLSocket.sendcCsb|j�|jr)td|j��n5|dkrHtj|||�Stj||||�SdS)Nz%sendto not allowed on instances of %s)r�r�rMrgr2�sendto)r{r�Z
flags_or_addr�addrrrr r��s
	zSSLSocket.sendtocOstd|j��dS)Nz&sendmsg not allowed on instances of %s)r�rg)r{ryrzrrr �sendmsg�szSSLSocket.sendmsgcCs�|j�|jr�|dkr5td|j��nt|�}d}x3||kr||j||d��}||7}qJW|Stj|||�SdS)Nrz6non-zero flags not allowed in calls to sendall() on %s)r�r�rMrgrOr�r2�sendall)r{r�r�Zamountr@r�rrr r��s
	zSSLSocket.sendallicCsY|j�|jrB|dkr5td|j��n|j|�Stj|||�SdS)Nrz3non-zero flags not allowed in calls to recv() on %s)r�r�rMrgr�r2�recv)r{�buflenr�rrr r��s
	
zSSLSocket.recvcCs�|j�|r+|dkr+t|�}n|dkr@d}n|jr{|dkrktd|j��n|j||�Stj||||�SdS)Nirz8non-zero flags not allowed in calls to recv_into() on %s)r�rOr�rMrgr�r2�	recv_into)r{r��nbytesr�rrr r��s
		zSSLSocket.recv_intocCs@|j�|jr)td|j��ntj|||�SdS)Nz'recvfrom not allowed on instances of %s)r�r�rMrgr2�recvfrom)r{r�r�rrr r��s

	zSSLSocket.recvfromcCsC|j�|jr)td|j��ntj||||�SdS)Nz,recvfrom_into not allowed on instances of %s)r�r�rMrgr2�
recvfrom_into)r{r�r�r�rrr r�s

	zSSLSocket.recvfrom_intocOstd|j��dS)Nz&recvmsg not allowed on instances of %s)r�rg)r{ryrzrrr �recvmsgszSSLSocket.recvmsgcOstd|j��dS)Nz+recvmsg_into not allowed on instances of %s)r�rg)r{ryrzrrr �recvmsg_intoszSSLSocket.recvmsg_intocCs(|j�|jr |jj�SdSdS)Nr)r�r��pending)r{rrr r�s
	
zSSLSocket.pendingcCs'|j�d|_tj||�dS)N)r�r�r2�shutdown)r{Zhowrrr r�s
	zSSLSocket.shutdowncCs?|jr%|jj�}d|_|Stdt|���dS)NzNo SSL wrapper around )r�r�rM�str)r{�srrr �unwraps
		zSSLSocket.unwrapcCsd|_tj|�dS)N)r�r2�_real_close)r{rrr r�$s	zSSLSocket._real_closecCs�|j�|j�}z3|dkr;|r;|jd�n|jj�Wd|j|�X|jjr�|js~td��nt	|j
�|j�ndS)zPerform a TLS/SSL handshake.gNz-check_hostname needs server_hostname argument)r�r�r�r�r�r�r�r�rMrTr�)r{�blockr�rrr r�(s
	zSSLSocket.do_handshakecCs�|jrtd��n|jr0td��n|jj|d|j�|_ya|rltj||�}nd}tj	||�|s�d|_|j
r�|j�q�n|SWn$ttfk
r�d|_�YnXdS)Nz!can't connect in server-side modez/attempt to connect already-connected SSLSocket!FT)
r~rMr�r�r�r�r�r2�
connect_ex�connectrr�r�)r{r�r��rcrrr �
_real_connect9s$					zSSLSocket._real_connectcCs|j|d�dS)zQConnects to remote ADDR, and then wraps the connection in
        an SSL channel.FN)r�)r{r�rrr r�PszSSLSocket.connectcCs|j|d�S)zQConnects to remote ADDR, and then wraps the connection in
        an SSL channel.T)r�)r{r�rrr r�UszSSLSocket.connect_excCsItj|�\}}|jj|d|jd|jdd�}||fS)z�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.rr�r~T)r2�acceptr�r�rr�)r{Znewsockr�rrr r�Zs			zSSLSocket.acceptz
tls-uniquecCs_|tkrtd��n|dkr?tdj|���n|jdkrRdS|jj�S)z�Get channel binding data for current connection.  Raise ValueError
        if the requested `cb_type` is not supported.  Return bytes of the data
        or None if the data is not available (e.g. before the handshake).
        z Unsupported channel binding typez
tls-uniquez({0} channel binding type not implementedN)�CHANNEL_BINDING_TYPESrMr��formatr�Z
tls_unique_cb)r{Zcb_typerrr �get_channel_bindingfszSSLSocket.get_channel_binding))r9r:r;rkrr'r3r4r|�propertyr��setterr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr r��sP		S	

r�Tc

CsCtd|d|d|d|d|d|d|d|d	|d
|	�
S)Nr}r�r�r~r�r�r�rr�r�)r�)
r}r�r�r~r�r�r�rr�r�rrr r�vsr�cCs%ddl}|j|j|d��S)z�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.rNz%b %d %H:%M:%S %Y GMT)�timeZmktimeZstrptime)Z	cert_timer�rrr �cert_time_to_seconds�sr�z-----BEGIN CERTIFICATE-----z-----END CERTIFICATE-----cCs?ttj|�dd�}tdtj|d�dtdS)z[Takes a certificate in binary DER format and returns the
    PEM version of it as a string.�ASCII�strict�
�@)r��base64Zstandard_b64encode�
PEM_HEADER�textwrapZfill�
PEM_FOOTER)Zder_cert_bytes�frrr �DER_cert_to_PEM_cert�sr�cCs�|jt�s"tdt��n|j�jt�sJtdt��n|j�tt�tt��}tj|j	dd��S)zhTakes a certificate in ASCII PEM format and returns the
    DER-encoded version of it as a byte sequencez(Invalid PEM encoding; must start with %sz&Invalid PEM encoding; must end with %sr�r�)
rr�rM�strip�endswithr�rOr�Zdecodebytes�encode)Zpem_cert_string�drrr �PEM_cert_to_DER_cert�s

#r�c
Cs�|\}}|dk	r!t}nt}t|d|d|�}t|��.}|j|��}|jd�}	WdQXWdQXt|	�S)z�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.Nr�r_T)rr�_create_stdlib_contextr5r�r�r�)
r�r�r��hostZportr�r�r}ZsslsockZdercertrrr �get_server_certificate�s			r�cCstj|d�S)Nz	<unknown>)�_PROTOCOL_NAMESrN)Z
protocol_coderrr �get_protocol_name�sr�)Xrkr�rDr�rY�collectionsrZenumrZ_Enumrrrrrrr	r
rrr
rrrrrdrrhrrrrr�ImportErrorr!r#r$r%r&rr�itemsr�r,rvr-r.r�r0r1r2r3r4r5r6r7r�r�r�Zsocket_errorZHAS_TLS_UNIQUEr�rxr�rMr8rLrTrUrXrarnrqror�r'r�Z_create_default_https_contextr�r�r�r�r�r�r�r�r�r�rrrr �<module>Ys�."











"	1+	8/'��	


Filemanager

Name Type Size Permission Actions
__future__.cpython-34.pyc File 4.07 KB 0644
__future__.cpython-34.pyo File 4.07 KB 0644
__phello__.foo.cpython-34.pyc File 134 B 0644
__phello__.foo.cpython-34.pyo File 134 B 0644
_bootlocale.cpython-34.pyc File 1.02 KB 0644
_bootlocale.cpython-34.pyo File 1016 B 0644
_collections_abc.cpython-34.pyc File 23.39 KB 0644
_collections_abc.cpython-34.pyo File 23.39 KB 0644
_compat_pickle.cpython-34.pyc File 7.33 KB 0644
_compat_pickle.cpython-34.pyo File 7.25 KB 0644
_dummy_thread.cpython-34.pyc File 4.71 KB 0644
_dummy_thread.cpython-34.pyo File 4.71 KB 0644
_markupbase.cpython-34.pyc File 8.72 KB 0644
_markupbase.cpython-34.pyo File 8.54 KB 0644
_osx_support.cpython-34.pyc File 10.38 KB 0644
_osx_support.cpython-34.pyo File 10.38 KB 0644
_pyio.cpython-34.pyc File 63.41 KB 0644
_pyio.cpython-34.pyo File 63.39 KB 0644
_sitebuiltins.cpython-34.pyc File 3.59 KB 0644
_sitebuiltins.cpython-34.pyo File 3.59 KB 0644
_strptime.cpython-34.pyc File 15.41 KB 0644
_strptime.cpython-34.pyo File 15.41 KB 0644
_sysconfigdata.cpython-34.pyc File 24.49 KB 0644
_sysconfigdata.cpython-34.pyo File 24.49 KB 0644
_threading_local.cpython-34.pyc File 6.78 KB 0644
_threading_local.cpython-34.pyo File 6.78 KB 0644
_weakrefset.cpython-34.pyc File 8.27 KB 0644
_weakrefset.cpython-34.pyo File 8.27 KB 0644
abc.cpython-34.pyc File 7.69 KB 0644
abc.cpython-34.pyo File 7.64 KB 0644
aifc.cpython-34.pyc File 27.26 KB 0644
aifc.cpython-34.pyo File 27.26 KB 0644
antigravity.cpython-34.pyc File 847 B 0644
antigravity.cpython-34.pyo File 847 B 0644
argparse.cpython-34.pyc File 64.33 KB 0644
argparse.cpython-34.pyo File 64.17 KB 0644
ast.cpython-34.pyc File 12.07 KB 0644
ast.cpython-34.pyo File 12.07 KB 0644
asynchat.cpython-34.pyc File 8.16 KB 0644
asynchat.cpython-34.pyo File 8.16 KB 0644
asyncore.cpython-34.pyc File 17.54 KB 0644
asyncore.cpython-34.pyo File 17.54 KB 0644
base64.cpython-34.pyc File 17.87 KB 0644
base64.cpython-34.pyo File 17.67 KB 0644
bdb.cpython-34.pyc File 18.26 KB 0644
bdb.cpython-34.pyo File 18.26 KB 0644
binhex.cpython-34.pyc File 13.22 KB 0644
binhex.cpython-34.pyo File 13.22 KB 0644
bisect.cpython-34.pyc File 2.79 KB 0644
bisect.cpython-34.pyo File 2.79 KB 0644
bz2.cpython-34.pyc File 14.8 KB 0644
bz2.cpython-34.pyo File 14.8 KB 0644
cProfile.cpython-34.pyc File 4.51 KB 0644
cProfile.cpython-34.pyo File 4.51 KB 0644
calendar.cpython-34.pyc File 26.92 KB 0644
calendar.cpython-34.pyo File 26.92 KB 0644
cgi.cpython-34.pyc File 29.13 KB 0644
cgi.cpython-34.pyo File 29.13 KB 0644
cgitb.cpython-34.pyc File 10.8 KB 0644
cgitb.cpython-34.pyo File 10.8 KB 0644
chunk.cpython-34.pyc File 5.15 KB 0644
chunk.cpython-34.pyo File 5.15 KB 0644
cmd.cpython-34.pyc File 13.14 KB 0644
cmd.cpython-34.pyo File 13.14 KB 0644
code.cpython-34.pyc File 9.47 KB 0644
code.cpython-34.pyo File 9.47 KB 0644
codecs.cpython-34.pyc File 34.31 KB 0644
codecs.cpython-34.pyo File 34.31 KB 0644
codeop.cpython-34.pyc File 6.31 KB 0644
codeop.cpython-34.pyo File 6.31 KB 0644
colorsys.cpython-34.pyc File 3.57 KB 0644
colorsys.cpython-34.pyo File 3.57 KB 0644
compileall.cpython-34.pyc File 7.21 KB 0644
compileall.cpython-34.pyo File 7.21 KB 0644
configparser.cpython-34.pyc File 43.83 KB 0644
configparser.cpython-34.pyo File 43.83 KB 0644
contextlib.cpython-34.pyc File 10.13 KB 0644
contextlib.cpython-34.pyo File 10.13 KB 0644
copy.cpython-34.pyc File 7.87 KB 0644
copy.cpython-34.pyo File 7.79 KB 0644
copyreg.cpython-34.pyc File 4.5 KB 0644
copyreg.cpython-34.pyo File 4.46 KB 0644
crypt.cpython-34.pyc File 2.38 KB 0644
crypt.cpython-34.pyo File 2.38 KB 0644
csv.cpython-34.pyc File 12.69 KB 0644
csv.cpython-34.pyo File 12.69 KB 0644
datetime.cpython-34.pyc File 54.95 KB 0644
datetime.cpython-34.pyo File 53.02 KB 0644
decimal.cpython-34.pyc File 168.48 KB 0644
decimal.cpython-34.pyo File 168.48 KB 0644
difflib.cpython-34.pyc File 59.1 KB 0644
difflib.cpython-34.pyo File 59.05 KB 0644
dis.cpython-34.pyc File 14.25 KB 0644
dis.cpython-34.pyo File 14.25 KB 0644
doctest.cpython-34.pyc File 78.23 KB 0644
doctest.cpython-34.pyo File 77.97 KB 0644
dummy_threading.cpython-34.pyc File 1.19 KB 0644
dummy_threading.cpython-34.pyo File 1.19 KB 0644
enum.cpython-34.pyc File 15.96 KB 0644
enum.cpython-34.pyo File 15.96 KB 0644
filecmp.cpython-34.pyc File 8.91 KB 0644
filecmp.cpython-34.pyo File 8.91 KB 0644
fileinput.cpython-34.pyc File 13.96 KB 0644
fileinput.cpython-34.pyo File 13.96 KB 0644
fnmatch.cpython-34.pyc File 3.07 KB 0644
fnmatch.cpython-34.pyo File 3.07 KB 0644
formatter.cpython-34.pyc File 18.47 KB 0644
formatter.cpython-34.pyo File 18.47 KB 0644
fractions.cpython-34.pyc File 18.82 KB 0644
fractions.cpython-34.pyo File 18.82 KB 0644
ftplib.cpython-34.pyc File 32.54 KB 0644
ftplib.cpython-34.pyo File 32.54 KB 0644
functools.cpython-34.pyc File 23.06 KB 0644
functools.cpython-34.pyo File 23.06 KB 0644
genericpath.cpython-34.pyc File 3.41 KB 0644
genericpath.cpython-34.pyo File 3.41 KB 0644
getopt.cpython-34.pyc File 6.58 KB 0644
getopt.cpython-34.pyo File 6.53 KB 0644
getpass.cpython-34.pyc File 4.52 KB 0644
getpass.cpython-34.pyo File 4.52 KB 0644
gettext.cpython-34.pyc File 14.82 KB 0644
gettext.cpython-34.pyo File 14.82 KB 0644
glob.cpython-34.pyc File 2.81 KB 0644
glob.cpython-34.pyo File 2.81 KB 0644
gzip.cpython-34.pyc File 18.99 KB 0644
gzip.cpython-34.pyo File 18.94 KB 0644
hashlib.cpython-34.pyc File 7.76 KB 0644
hashlib.cpython-34.pyo File 7.76 KB 0644
heapq.cpython-34.pyc File 13.58 KB 0644
heapq.cpython-34.pyo File 13.58 KB 0644
hmac.cpython-34.pyc File 5.03 KB 0644
hmac.cpython-34.pyo File 5.03 KB 0644
imaplib.cpython-34.pyc File 42.46 KB 0644
imaplib.cpython-34.pyo File 40 KB 0644
imghdr.cpython-34.pyc File 4.05 KB 0644
imghdr.cpython-34.pyo File 4.05 KB 0644
imp.cpython-34.pyc File 9.64 KB 0644
imp.cpython-34.pyo File 9.64 KB 0644
inspect.cpython-34.pyc File 74.54 KB 0644
inspect.cpython-34.pyo File 74.22 KB 0644
io.cpython-34.pyc File 3.38 KB 0644
io.cpython-34.pyo File 3.38 KB 0644
ipaddress.cpython-34.pyc File 61.51 KB 0644
ipaddress.cpython-34.pyo File 61.51 KB 0644
keyword.cpython-34.pyc File 1.9 KB 0644
keyword.cpython-34.pyo File 1.9 KB 0644
linecache.cpython-34.pyc File 3.04 KB 0644
linecache.cpython-34.pyo File 3.04 KB 0644
locale.cpython-34.pyc File 36.4 KB 0644
locale.cpython-34.pyo File 36.4 KB 0644
lzma.cpython-34.pyc File 15.54 KB 0644
lzma.cpython-34.pyo File 15.54 KB 0644
macpath.cpython-34.pyc File 5.87 KB 0644
macpath.cpython-34.pyo File 5.87 KB 0644
macurl2path.cpython-34.pyc File 2.05 KB 0644
macurl2path.cpython-34.pyo File 2.05 KB 0644
mailbox.cpython-34.pyc File 68.64 KB 0644
mailbox.cpython-34.pyo File 68.54 KB 0644
mailcap.cpython-34.pyc File 6.39 KB 0644
mailcap.cpython-34.pyo File 6.39 KB 0644
mimetypes.cpython-34.pyc File 16.41 KB 0644
mimetypes.cpython-34.pyo File 16.41 KB 0644
modulefinder.cpython-34.pyc File 16.97 KB 0644
modulefinder.cpython-34.pyo File 16.89 KB 0644
netrc.cpython-34.pyc File 4.18 KB 0644
netrc.cpython-34.pyo File 4.18 KB 0644
nntplib.cpython-34.pyc File 35.46 KB 0644
nntplib.cpython-34.pyo File 35.46 KB 0644
ntpath.cpython-34.pyc File 12.99 KB 0644
ntpath.cpython-34.pyo File 12.99 KB 0644
nturl2path.cpython-34.pyc File 1.68 KB 0644
nturl2path.cpython-34.pyo File 1.68 KB 0644
numbers.cpython-34.pyc File 12.37 KB 0644
numbers.cpython-34.pyo File 12.37 KB 0644
opcode.cpython-34.pyc File 5.05 KB 0644
opcode.cpython-34.pyo File 5.05 KB 0644
operator.cpython-34.pyc File 12.48 KB 0644
operator.cpython-34.pyo File 12.48 KB 0644
optparse.cpython-34.pyc File 50.33 KB 0644
optparse.cpython-34.pyo File 50.25 KB 0644
os.cpython-34.pyc File 28.91 KB 0644
os.cpython-34.pyo File 28.91 KB 0644
pathlib.cpython-34.pyc File 39.53 KB 0644
pathlib.cpython-34.pyo File 39.53 KB 0644
pdb.cpython-34.pyc File 48.31 KB 0644
pdb.cpython-34.pyo File 48.25 KB 0644
pickle.cpython-34.pyc File 45.88 KB 0644
pickle.cpython-34.pyo File 45.74 KB 0644
pickletools.cpython-34.pyc File 68.61 KB 0644
pickletools.cpython-34.pyo File 67.55 KB 0644
pipes.cpython-34.pyc File 8.23 KB 0644
pipes.cpython-34.pyo File 8.23 KB 0644
pkgutil.cpython-34.pyc File 17.19 KB 0644
pkgutil.cpython-34.pyo File 17.19 KB 0644
platform.cpython-34.pyc File 30.44 KB 0644
platform.cpython-34.pyo File 30.44 KB 0644
plistlib.cpython-34.pyc File 29.44 KB 0644
plistlib.cpython-34.pyo File 29.36 KB 0644
poplib.cpython-34.pyc File 13.43 KB 0644
poplib.cpython-34.pyo File 13.43 KB 0644
posixpath.cpython-34.pyc File 9.58 KB 0644
posixpath.cpython-34.pyo File 9.58 KB 0644
pprint.cpython-34.pyc File 11.19 KB 0644
pprint.cpython-34.pyo File 11.03 KB 0644
profile.cpython-34.pyc File 14.8 KB 0644
profile.cpython-34.pyo File 14.55 KB 0644
pstats.cpython-34.pyc File 23.12 KB 0644
pstats.cpython-34.pyo File 23.12 KB 0644
pty.cpython-34.pyc File 4.13 KB 0644
pty.cpython-34.pyo File 4.13 KB 0644
py_compile.cpython-34.pyc File 6.7 KB 0644
py_compile.cpython-34.pyo File 6.7 KB 0644
pyclbr.cpython-34.pyc File 8.98 KB 0644
pyclbr.cpython-34.pyo File 8.98 KB 0644
pydoc.cpython-34.pyc File 88.78 KB 0644
pydoc.cpython-34.pyo File 88.72 KB 0644
queue.cpython-34.pyc File 9.04 KB 0644
queue.cpython-34.pyo File 9.04 KB 0644
quopri.cpython-34.pyc File 6.29 KB 0644
quopri.cpython-34.pyo File 6.09 KB 0644
random.cpython-34.pyc File 18.61 KB 0644
random.cpython-34.pyo File 18.61 KB 0644
re.cpython-34.pyc File 14.21 KB 0644
re.cpython-34.pyo File 14.21 KB 0644
reprlib.cpython-34.pyc File 5.73 KB 0644
reprlib.cpython-34.pyo File 5.73 KB 0644
rlcompleter.cpython-34.pyc File 5.56 KB 0644
rlcompleter.cpython-34.pyo File 5.56 KB 0644
runpy.cpython-34.pyc File 7.57 KB 0644
runpy.cpython-34.pyo File 7.57 KB 0644
sched.cpython-34.pyc File 6.42 KB 0644
sched.cpython-34.pyo File 6.42 KB 0644
selectors.cpython-34.pyc File 16.35 KB 0644
selectors.cpython-34.pyo File 16.35 KB 0644
shelve.cpython-34.pyc File 9.72 KB 0644
shelve.cpython-34.pyo File 9.72 KB 0644
shlex.cpython-34.pyc File 7.34 KB 0644
shlex.cpython-34.pyo File 7.34 KB 0644
shutil.cpython-34.pyc File 32.24 KB 0644
shutil.cpython-34.pyo File 32.24 KB 0644
site.cpython-34.pyc File 17.55 KB 0644
site.cpython-34.pyo File 17.55 KB 0644
smtpd.cpython-34.pyc File 25.07 KB 0644
smtpd.cpython-34.pyo File 25.07 KB 0644
smtplib.cpython-34.pyc File 32.35 KB 0644
smtplib.cpython-34.pyo File 32.28 KB 0644
sndhdr.cpython-34.pyc File 6.61 KB 0644
sndhdr.cpython-34.pyo File 6.61 KB 0644
socket.cpython-34.pyc File 17.69 KB 0644
socket.cpython-34.pyo File 17.64 KB 0644
socketserver.cpython-34.pyc File 22.71 KB 0644
socketserver.cpython-34.pyo File 22.71 KB 0644
sre_compile.cpython-34.pyc File 11.66 KB 0644
sre_compile.cpython-34.pyo File 11.5 KB 0644
sre_constants.cpython-34.pyc File 5.45 KB 0644
sre_constants.cpython-34.pyo File 5.45 KB 0644
sre_parse.cpython-34.pyc File 19.76 KB 0644
sre_parse.cpython-34.pyo File 19.76 KB 0644
ssl.cpython-34.pyc File 26.96 KB 0644
ssl.cpython-34.pyo File 26.96 KB 0644
stat.cpython-34.pyc File 3.49 KB 0644
stat.cpython-34.pyo File 3.49 KB 0644
statistics.cpython-34.pyc File 16.76 KB 0644
statistics.cpython-34.pyo File 16.46 KB 0644
string.cpython-34.pyc File 8.18 KB 0644
string.cpython-34.pyo File 8.18 KB 0644
stringprep.cpython-34.pyc File 13.32 KB 0644
stringprep.cpython-34.pyo File 13.25 KB 0644
struct.cpython-34.pyc File 347 B 0644
struct.cpython-34.pyo File 347 B 0644
subprocess.cpython-34.pyc File 42.34 KB 0644
subprocess.cpython-34.pyo File 42.23 KB 0644
sunau.cpython-34.pyc File 17.88 KB 0644
sunau.cpython-34.pyo File 17.88 KB 0644
symbol.cpython-34.pyc File 2.6 KB 0644
symbol.cpython-34.pyo File 2.6 KB 0644
symtable.cpython-34.pyc File 11.04 KB 0644
symtable.cpython-34.pyo File 10.92 KB 0644
sysconfig.cpython-34.pyc File 16.88 KB 0644
sysconfig.cpython-34.pyo File 16.88 KB 0644
tabnanny.cpython-34.pyc File 7.57 KB 0644
tabnanny.cpython-34.pyo File 7.57 KB 0644
tarfile.cpython-34.pyc File 66.45 KB 0644
tarfile.cpython-34.pyo File 66.45 KB 0644
telnetlib.cpython-34.pyc File 18.94 KB 0644
telnetlib.cpython-34.pyo File 18.94 KB 0644
tempfile.cpython-34.pyc File 21.07 KB 0644
tempfile.cpython-34.pyo File 21.07 KB 0644
textwrap.cpython-34.pyc File 13.48 KB 0644
textwrap.cpython-34.pyo File 13.39 KB 0644
this.cpython-34.pyc File 1.29 KB 0644
this.cpython-34.pyo File 1.29 KB 0644
threading.cpython-34.pyc File 38.05 KB 0644
threading.cpython-34.pyo File 37.36 KB 0644
timeit.cpython-34.pyc File 10.8 KB 0644
timeit.cpython-34.pyo File 10.8 KB 0644
token.cpython-34.pyc File 3.53 KB 0644
token.cpython-34.pyo File 3.53 KB 0644
tokenize.cpython-34.pyc File 19.48 KB 0644
tokenize.cpython-34.pyo File 19.43 KB 0644
trace.cpython-34.pyc File 23.62 KB 0644
trace.cpython-34.pyo File 23.56 KB 0644
traceback.cpython-34.pyc File 10.83 KB 0644
traceback.cpython-34.pyo File 10.83 KB 0644
tracemalloc.cpython-34.pyc File 16.73 KB 0644
tracemalloc.cpython-34.pyo File 16.73 KB 0644
tty.cpython-34.pyc File 1.12 KB 0644
tty.cpython-34.pyo File 1.12 KB 0644
types.cpython-34.pyc File 5.43 KB 0644
types.cpython-34.pyo File 5.43 KB 0644
uu.cpython-34.pyc File 3.93 KB 0644
uu.cpython-34.pyo File 3.93 KB 0644
uuid.cpython-34.pyc File 21.35 KB 0644
uuid.cpython-34.pyo File 21.29 KB 0644
warnings.cpython-34.pyc File 11.98 KB 0644
warnings.cpython-34.pyo File 11.27 KB 0644
wave.cpython-34.pyc File 18.69 KB 0644
wave.cpython-34.pyo File 18.63 KB 0644
weakref.cpython-34.pyc File 19.87 KB 0644
weakref.cpython-34.pyo File 19.83 KB 0644
webbrowser.cpython-34.pyc File 16.73 KB 0644
webbrowser.cpython-34.pyo File 16.69 KB 0644
xdrlib.cpython-34.pyc File 8.79 KB 0644
xdrlib.cpython-34.pyo File 8.79 KB 0644
zipfile.cpython-34.pyc File 44.75 KB 0644
zipfile.cpython-34.pyo File 44.7 KB 0644