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/boto/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/__pycache__/https_connection.cpython-310.pyc
o

ckF[�@sldZddlZddlZddlZddlZddlmZmZGdd�dej�Z	dd�Z
dd	�ZGd
d�dej�Z
dS)zCExtensions to allow HTTPS requests with SSL certificate validation.�N)�six�http_clientc@s eZdZdZdd�Zdd�ZdS)�InvalidCertificateExceptionz?Raised when a certificate is provided with an invalid hostname.cCs"tj�|�||_||_||_dS)z�Constructor.

        Args:
          host: The hostname the connection was made to.
          cert: The SSL certificate (as a dictionary) the host returned.
        N)r�
HTTPException�__init__�host�cert�reason)�selfrrr	�r�7/usr/lib/python3/dist-packages/boto/https_connection.pyr"s
z$InvalidCertificateException.__init__cCsd|j|j|jfS)Nz0Host %s returned an invalid certificate (%s): %s)rr	r)r
rrr�__str__.s�z#InvalidCertificateException.__str__N)�__name__�
__module__�__qualname__�__doc__rr
rrrrrsrcCs,d|vr
dd�|dD�Sdd�|dD�S)z�Returns a list of valid host globs for an SSL certificate.

    Args:
      cert: A dictionary representing an SSL certificate.
    Returns:
      list: A list of valid host globs.
    �subjectAltNamecSs$g|]}|d��dkr|d�qS)r�dns���lower��.0�xrrr�
<listcomp><s$z(GetValidHostsForCert.<locals>.<listcomp>cSs,g|]}|dd��dkr|dd�qS)r�
commonnamerrrrrrr>s
��subjectr)rrrr�GetValidHostsForCert3srcCsVt|�}tj�d||�|D]}|�dd��dd�}t�d|f|tj�r(dSqdS)	aValidates that a given hostname is valid for an SSL certificate.

    Args:
      cert: A dictionary representing an SSL certificate.
      hostname: The hostname to test.
    Returns:
      bool: Whether or not the hostname is valid for this certificate.
    z@validating server certificate: hostname=%s, certificate hosts=%s�.z\.�*z[^.]*z^%s$TF)r�boto�log�debug�replace�re�search�I)r�hostname�hostsr�host_rerrr�ValidateCertificateHostnameBs	��r*c@s2eZdZdZejZeddddfdd�Zdd�ZdS)�CertValidatingHTTPSConnectionzDAn HTTPConnection that connects over SSL and validates certificates.NcKs>tjr||d<tjj|f||d�|��||_||_||_dS)a*Constructor.

        Args:
          host: The hostname. Can be in 'host:port' form.
          port: The port. Defaults to 443.
          key_file: A file containing the client's private key
          cert_file: A file containing the client's certificates
          ca_certs: A file contianing a set of concatenated certificate authority
              certs for validating the server against.
          strict: When true, causes BadStatusLine to be raised if the status line
              can't be parsed as a valid HTTP/1.0 or 1.1 status line.
        �strict)r�portN)r�PY2r�HTTPConnectionr�key_file�	cert_file�ca_certs)r
rr-r0r1r2r,�kwargsrrrr[s
z&CertValidatingHTTPSConnection.__init__cCs�t|d�rt�|j|jf|j�}n	t�|j|jf�}d}|jr'|d|j7}n|d7}tj�	|�t
j||j|j
t
j|jd�|_|j��}|j�dd�d}t||�s[t||d|��d	S)
z(Connect to a host on a given (SSL) port.�timeoutzwrapping ssl socket; zCA certificate file=%szusing system provided SSL certs)�keyfile�certfile�	cert_reqsr2�:rz/remote hostname "%s" does not match certificateN)�hasattr�socket�create_connectionrr-r4r2r r!r"�ssl�wrap_socketr0r1�
CERT_REQUIRED�sock�getpeercert�splitr*r)r
r?�msgrr'rrr�connectts.

�

���z%CertValidatingHTTPSConnection.connect)	rrrrr�
HTTPS_PORT�default_portrrCrrrrr+Vs
�r+)rr$r:r<r �boto.compatrrrrrr*r/r+rrrr�<module>s

https://t.me/RX1948 - 2025