OwlCyberSecurity - MANAGER
Edit File: connection.cpython-312.pyc
� ����W��g��������������������������d�dl�mZ�d�dlZd�dlZd�dlZd�dlZd�dlZd�dlZd�dl Z d�dl Z d�dlZd�dlZd�dlm Z�d�dlmZ�d�dlmZ�d�dlmZ�ej&������������������rddlmZ�dd lmZ�dd lmZ�ddlmZ�ddlmZ�dd lm Z �ddl!m"Z"m#Z#m$Z$�ddl%m&Z&�ddl'm(Z(� �d�dl)Z)e)jT������������������Z+ddl/m0Z0�ddl/m1Z1�ddl/m2Z2�ddl3m4Z4�ddl5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;�ddl<m=Z=m>Z>m?Z?m@Z@�ddlAmBZB�ddlmCZD�ddlmEZEmFZFmGZGmHZHmIZI�ddlJmKZKmLZL�ddlMmNZN�eOZOePZP�ej�������������������eR�������ZSddd �ZT�ej�������������������d!d"d�������ZV�ej�������������������d#�������ZX�G�d$��d%e�������Z �G�d&��d'e �������ZY�G�d(��d)ej��������������������������Z[d*d+� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �d3d,�Z\ �d4 � � � � � � �d5d-�Z]d6d.�Z^d7d/�Z_�G�d0��d1�������Z`e)se`ZYeYZa �d8 � � � � �d9d2�Zby#�e,e-f$�r�dZ)�G�d��de.�������Z+Y���8w�xY�w):�����)�annotationsN)�HTTPConnection)� HTTPException)�ResponseNotReady��timeout������HTTPResponse)�_TYPE_PEER_CERT_RET_DICT)�SSLTransport)�HTTPHeaderDict)�probe)�assert_header_parsing)�_DEFAULT_TIMEOUT� _TYPE_TIMEOUT�Timeout)�to_str)� wait_for_readc������������������������e�Zd�Zy)�BaseSSLErrorN)�__name__� __module__�__qualname__��������A/opt/hc_python/lib/python3.12/site-packages/urllib3/connection.pyr���r���%���s������r���r���)� _TYPE_BODY)�ProxyConfig)�_ResponseOptions��__version__)�ConnectTimeoutError�HeaderParsingError�NameResolutionError�NewConnectionError� ProxyError�SystemTimeWarning)�SKIP_HEADER�SKIPPABLE_HEADERS� connection�ssl_)�body_to_chunks)�assert_fingerprint)�create_urllib3_context�is_ipaddress�resolve_cert_reqs�resolve_ssl_version�ssl_wrap_socket)�CertificateError�match_hostname)�Url�P���i�����http�httpsi�������z[^-!#$%&'*+.^_`|~0-9a-zA-Z]c�������������������������e�Zd�ZU�dZed���Zded<���ej������������������ej������������������dfgZ ded<���dZd ed <���dZded <���ded<���ded<���ded<���d ed<���ded<���ded<���ded<���ded<��� �d3e dde ddd� � � � � � � � � � � � � � � � � �d4��fd�Zed5d���������Zej"������������������d6d ���������Zd7d!�Z � � �d8 � � � � � � � � �d9��fd"� Zej*������������������d#k��rd:d$�Zd:d%�Zed;d&���������Zed;d'���������Zed;d(���������Zed;d)���������Zed;d*���������Zd:��fd+�Z � �d< � � � � � � � � �d=��fd,� Zd>��fd-�Z � �d?dd.d.d.d/� � � � � � � � � � � � � � � � � �d@d0�Z � �d? � � � � � � � � �dAd1�Z! � �dB��fd2�Z"��xZ#S�)Cr���a��� Based on :class:`http.client.HTTPConnection` but provides an extra constructor backwards-compatibility layer between older and newer Pythons. Additional keyword parameters are used to configure attributes of the connection. Accepted parameters include: - ``source_address``: Set the source address for the current connection. - ``socket_options``: Set specific options on the underlying socket. If not specified, then defaults are loaded from ``HTTPConnection.default_socket_options`` which includes disabling Nagle's algorithm (sets TCP_NODELAY to 1) unless the connection is behind a proxy. For example, if you wish to enable TCP Keep Alive in addition to the defaults, you might pass: .. code-block:: python HTTPConnection.default_socket_options + [ (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1), ] Or you may want to disable the defaults by passing an empty list (e.g., ``[]``). r9���ztyping.ClassVar[int]�default_portr ���z0typing.ClassVar[connection._TYPE_SOCKET_OPTIONS]�default_socket_optionsF�bool�is_verifiedNzbool | None�proxy_is_verified�int� blocksize�tuple[str, int] | None�source_addressz&connection._TYPE_SOCKET_OPTIONS | None�socket_options�_has_connected_to_proxyz_ResponseOptions | None�_response_options� str | None�_tunnel_host� int | None�_tunnel_port�_tunnel_scheme��@��)r���rE���rC���rF����proxy�proxy_configc�����������������������t���������� |����||t��������j������������������|�������||���������||�_��������||�_��������||�_��������d|�_��������d�|�_��������d�|�_ ��������d�|�_ ��������d�|�_��������y�)N)�host�portr���rE���rC���F)�super�__init__r����resolve_default_timeoutrF���rO���rP���rG���rH���rJ���rL���rM���) �selfrR���rS���r���rE���rC���rF���rO���rP���� __class__s ��� �r���rU���zHTTPConnection.__init__����sr�������� ������3�3�G�<�)��� �� ��-����� �(���',��$�!%���(,���(,���*.��r���c�����������������8�����|�j�������������������j������������������d�������S�)a��� Getter method to remove any trailing dots that indicate the hostname is an FQDN. In general, SSL certificates don't include the trailing dot indicating a fully-qualified domain name, and thus, they don't validate properly when checked against a domain name that includes the dot. In addition, some servers may not expect to receive the trailing dot when provided. However, the hostname with trailing dot is critical to DNS resolution; doing a lookup with the trailing dot will properly only resolve the appropriate FQDN, whereas a lookup without a trailing dot will search the system's search domain list. Thus, it's important to keep the original host around for use only in those cases where it's appropriate (i.e., when doing DNS lookup to establish the actual TCP connection across which we're going to send HTTP requests). �.)� _dns_host�rstrip�rW���s��� r���rR���zHTTPConnection.host����s������"��~�~�$�$�S�)�)r���c����������������������||�_���������y)z� Setter for the `host` property. We assume that only urllib3 uses the _dns_host attribute; httplib itself only uses `host`, and it seems reasonable that other libraries follow suit. N)r[���)rW����values��� r���rR���zHTTPConnection.host����s���������r���c����������� ����������� �t��������j������������������|�j������������������|�j������������������f|�j������������������|�j ������������������|�j��������������������������}t��������j ������������������d|�|�j������������������|�j��������������������������|S�#�t��������j������������������$�r}t��������|�j������������������|�|�������|�d}~wt��������$�r-}t��������|�d|�j��������������������d|�j��������������������d��������|�d}~wt��������$�r}t��������|�d|����������|�d}~ww�xY�w)zoEstablish a socket connection and set nodelay settings on it. :return: New socket connection. )rE���rF���NzConnection to z timed out. (connect timeout=�)z&Failed to establish a new connection: zhttp.client.connect)r+����create_connectionr[���rS���r���rE���rF����socket�gaierrorr%���rR���� SocketTimeoutr#����OSErrorr&����sys�audit)rW����sock�es��� r���� _new_connzHTTPConnection._new_conn����s������� ��/�/�������+����#�2�2�#�2�2� �D�&� � � �'��t�y�y�$�)�)�D��������� A�%�d�i�i��q�9�q�@���� �%�� �����+H�����VW�X���� �� ��� �$��>�q�c�B��� �� �s0����A A=��=C=�B(�(C=�4(C�C=�(C8�8C=c�����������������^������|dvrt��������d|�d���������t���������|�� ��|||���������||�_��������y�)Nr8���z$Invalid proxy scheme for tunneling: z", must be either 'http' or 'https')rS����headers)� ValueErrorrT���� set_tunnelrM���)rW���rR���rS���rm����schemerX���s��� �r���ro���zHTTPConnection.set_tunnel����sF���������*�*��6�v�j�@b�c��� �� ���4�d�G��<�$��r���)������������c����������������������t���������j������������������j������������������}d|�j������������������j ������������������d�������|�j ������������������fz��}|g}|�j������������������j��������������������������D�]+��\��}}|j������������������|��d|��d�j ������������������d����������������-�|j������������������d��������|�j������������������dj������������������|���������������~|�j������������������|�j������������������|�j��������������������������} �|j��������������������������\��}}} |t���������j������������������j ������������������k7��r/|�j#���������������������������t%��������d |��d | j'������������������������������������� �|j(������������������j+������������������|dz����������} t-��������| �������|kD��rt���������j������������������j/������������������d��������| sn/| d v�rn*|�j0������������������dkD��rt3��������d| j5�����������������������������������}|j#���������������������������y�#�|j#���������������������������w�xY�w)Ns���CONNECT %s:%d HTTP/1.0 �asciiz: z zlatin-1���� r���)�methodzTunnel connection failed: � r ���zheader line)rv������� r���r���zheader:)r9����client�_MAXLINErJ����encoderL����_tunnel_headers�items�append�send�join�response_classri����_method�_read_status� HTTPStatus�OK�closerf����strip�fp�readline�len�LineTooLong� debuglevel�print�decode)rW���r{����connectrm����headerr_����response�version�code�message�lines��� r����_tunnelzHTTPConnection._tunnel����s�������{�{�+�+�H�3��!�!�(�(��1��!�!�7���G���i�G�!%�!5�!5�!;�!;�!=� ������&���E�7�$�7�>�>�y�I�J��">��N�N�7�#�� �I�I�c�h�h�w�'�(���*�*�4�9�9�T�\�\�*�J�H� !�+3�+@�+@�+B�(��$���4�?�?�-�-�-��J�J�L�!�$>�t�f�A�g�m�m�o�EV�"W�X�X��#�;�;�/�/��1��=�D��4�y�8�+�"�k�k�5�5�m�D�D����4�4������*��i�����7������� ����� �s ����*CG��G+c�����������������������|�j��������������������������|�_��������|�j������������������rd|�_��������|�j ���������������������������t��������|�j�������������������������|�_��������|�j������������������rd|�_��������y�y�)NTF)rk���ri���rJ���rG���r����r?���rO���rA���r]���s��� r���r����zHTTPConnection.connect��sU�������N�N�$�� ����+/�D�(�� �L�L�N� �(,�D�J�J�'7��$��'�'�%*�D�"��(r���c����������������������|�j�������������������d�u�S��N)ri���r]���s��� r���� is_closedzHTTPConnection.is_closed$��s�������y�y�D� � r���c�����������������L�����|�j��������������������yt��������|�j�������������������d���������S�)NFg��������r���)ri���r���r]���s��� r����is_connectedzHTTPConnection.is_connected(��s#�������9�9��� ����C�8�8�8r���c����������������������|�j�������������������S�r����)rG���r]���s��� r����has_connected_to_proxyz%HTTPConnection.has_connected_to_proxy.��s�������+�+�+r���c�����������������L�����t��������|�j�������������������������xr�|�j������������������du�S�)zT Return True if a forwarding proxy is configured, else return False N)r?���rO���rJ���r]���s��� r����proxy_is_forwardingz"HTTPConnection.proxy_is_forwarding2��s#������ ��D�J�J��=�D�$5�$5��$=�=r���c����������������������|�j�������������������duS�)zS Return True if a tunneling proxy is configured, else return False N)rJ���r]���s��� r����proxy_is_tunnelingz!HTTPConnection.proxy_is_tunneling9��s������ �� � ��,�,r���c���������������������� �t����������|�������������d�|�_��������d|�_��������d�|�_��������d|�_��������d�|�_��������d�|�_��������d�|�_��������d�|�_ ��������y�#�d�|�_��������d|�_��������d�|�_��������d|�_��������d�|�_��������d�|�_��������d�|�_��������d�|�_ ��������w�xY�w)NF) rT���r����ri���r@���rA���rG���rH���rJ���rL���rM���)rW���rX���s��� �r���r����zHTTPConnection.close@��s�������� '��G�M�O���D�I�$�D��%)�D�"�+0�D�(�%)�D�"� $�D�� $�D��"&�D�����D�I�$�D��%)�D�"�+0�D�(�%)�D�"� $�D�� $�D��"&�D��s����A �� :Bc�����������������������t���������j������������������|�������}|r t��������d|�d|j���������������������������d���������t���������|����||||��������S�)��z+Method cannot contain non-token characters z (found at least ra���)� skip_host�skip_accept_encoding)�_CONTAINS_CONTROL_CHAR_RE�searchrn����grouprT���� putrequest)rW���rw����urlr����r�����matchrX���s��� �r���r����zHTTPConnection.putrequestO��sg��������*�0�0��8����=�f�Z�GX�Y^�Yd�Yd�Yf�Xi�ij�k��� ���w�!��C�9�CW��"�� �� r���c�����������������0�����t��������d��|D����������������st���������|����|g|�����yt��������|j ���������������������������������t ��������vrNdj ������������������t��������t ���������������D��cg�c]��}t��������j������������������|����������c}�������}t��������d|��d���������yc�c}w�)r����c��������������3���R���K����|�]��}t��������|t���������������xr �|t��������k(������!�y��wr����)� isinstance�strr)���)�.0�vs��� r���� <genexpr>z+HTTPConnection.putheader.<locals>.<genexpr>e��s%���������K�F�q�:�a��%�:�!�{�*:�:�F�s����%'z', 'z(urllib3.util.SKIP_HEADER only supports '�'N)�anyrT���� putheaderr����lowerr*���r�����sortedr�����titlern���)rW���r�����values�skippable_headersrX���s��� �r���r����zHTTPConnection.putheaderc��s���������K�F�K�K��G��f�.�v�.� �F�L�L�N� #�+<� <� &���17�8I�1J�K�1J�v����6�"�1J�K�!����:�;L�:M�Q�O��� � �=��Ks���� BT)�chunked�preload_content�decode_content�enforce_content_lengthc��������������������|�j��������������������%|�j�������������������j������������������|�j��������������������������t��������|||||��������|�_��������|�i�}t��������d��|D����������������} d| v�} d| v�}|�j ������������������||| |���������t��������|||�j��������������������������}|j������������������} |j������������������}|rd| vrW|�j������������������dd ��������nDd | v�rd}n=d| v�rd}n6d}|�| �0d}|�j������������������dd ��������n|�j������������������d t��������|���������������d| vr|�j������������������dt������������������������|j��������������������������D�]��\��}}|�j������������������||����������|�j���������������������������| �^| D�]Y��}|s�t!��������|t���������������r|j#������������������d�������}|r |�j%������������������dt'��������|�������|fz�����������I|�j%������������������|���������[�|r|�j%������������������d��������y�y�)N)�request_method�request_urlr����r����r����c��������������3���N���K����|�]��}t��������|j��������������������������������������y��wr����)r���r����)r�����ks��� r���r����z)HTTPConnection.request.<locals>.<genexpr>���s���������C�7�a��q�w�w�y� 1�7�s����#%zaccept-encodingrR���)r����r����)rw���rC���ztransfer-encodingzTransfer-Encodingr����zcontent-lengthFTzContent-Lengthz user-agentz User-Agentzutf-8s���%x %b s���0 )ri���� settimeoutr���r ���rH���� frozensetr����r-���rC����chunks�content_lengthr����r�����_get_default_user_agentr~���� endheadersr����r|���r����r����)rW���rw���r�����bodyrm���r����r����r����r�����header_keysr����r����� chunks_and_clr����r����r����r_����chunks��� r����requestzHTTPConnection.requestq��s��������9�9� ��I�I� � ����.��"2�!��+�)�#9�" �����?��G��C�7�C�C��0�K�?���k�)� �����C�.B�i�� �� ��'�t�F�d�n�n�U� ��%�%��&�5�5����"�+�5����2�I�>� � �;�.���$��3���� ��!�)��)�"&�����':�I�F��N�N�#3�S��5H�I���{�*��N�N�<�)@�)B�C�$�]�]�_�M�F�E��N�N�6�5�)��-��������������e�S�)�!�L�L��1�E���I�I�o��U��U�0C�C�D��I�I�e�$�� ����I�I�l�#��r���c�����������������h�����t��������j������������������dt��������d���������|�j������������������||||d���������y)z� Alternative to the common request method, which sends the body with chunked encoding and not as one block z�HTTPConnection.request_chunked() is deprecated and will be removed in urllib3 v2.1.0. Instead use HTTPConnection.request(..., chunked=True).������category� stacklevelT)r����rm���r����N)�warnings�warn�DeprecationWarningr����)rW���rw���r����r����rm���s��� r����request_chunkedzHTTPConnection.request_chunked���s4������� � � � X�'�� �� ���V�S�t�W�d��Kr���c�����������������������|�j�������������������� t�����������������|�j�������������������}d|�_���������|�j������������������j������������������|�j��������������������������ddlm}�t��������|�j������������������dd�������}t���������|��%����������} �t��������|j��������������������������t%��������|j������������������j'���������������������������������}�||||j(������������������|j*������������������t��������|�dd �������|j,������������������|j.������������������|j0������������������||j2������������������|j4������������������|j"������������������|� � ������}|S�#�t��������t��������f$�r7}t��������j������������������dt!��������|�|j"�������������������������|d���������Y�d}~��d}~ww�xY�w)a��� Get the response from the server. If the HTTPConnection is in the correct state, returns an instance of HTTPResponse or of whatever object is returned by the response_class variable. If a request has not been sent or if a previous response has not be handled, ResponseNotReady is raised. If the HTTP response indicates that the connection should be closed, then it will be closed before the response is returned. When the connection is closed, the underlying socket is closed. Nr ���r ����shutdownz$Failed to parse headers (url=%s): %sT)�exc_info� _http_vsn_strzHTTP/?) r����rm����statusr�����version_string�reasonr����r�����original_responser����r����r����� sock_shutdown)rH���r���ri���r����r���r����r����getattrrT����getresponser����msgr$���� TypeError�log�warning�_url_from_connectionr����r���r~���r����r����r����r����r����r����r����) rW����resp_optionsr���� _shutdown�httplib_response�hperm���r����rX���s ��� �r���r����zHTTPConnection.getresponse���sW��������!�!�)�"�$�$���-�-��!%���� � � ���T�\�\�*�� +� ��D�I�I�z�4�8� ��!�7�.�0�� �!�"2�"6�"6�7��!�!1�!5�!5�!;�!;�!=�>���!��#�*�*�$�,�,�"�4��(�C�#�*�*�(�8�8�'�6�6�.�#/�#F�#F�'�6�6�$�0�0�#� ������3�#�I�.�� ��K�K�6�$�T�<�+C�+C�D��� � �� �� �� �s����<D&��&E,�5-E'�'E,r����)rR���r����rS���rK���r���r���rE���rD���rC���rB���rF����&None | connection._TYPE_SOCKET_OPTIONSrO���� Url | NonerP����ProxyConfig | None�return�None�r����r����)r_���r����r����r����)r����� socket.socket)NNr9���) rR���r����rS���rK���rm����typing.Mapping[str, str] | Nonerp���r����r����r�����r����r����)r����r?���)FF) rw���r����r����r����r����r?���r����r?���r����r����)r����r����r����r����r����r����)NN)rw���r����r����r����r�����_TYPE_BODY | Nonerm���r����r����r?���r����r?���r����r?���r����r?���r����r����) rw���r����r����r����r����r����rm���r����r����r����)r����r���)$r���r���r����__doc__�port_by_schemer=����__annotations__rc����IPPROTO_TCP�TCP_NODELAYr>���r@���rA���r���rU����propertyrR����setterrk���ro���rg����version_infor����r����r����r����r����r����r����r����r����r����r����r����r����� __classcell__�rX���s���@r���r���r���R���s�������0�*8��)?�L�&�?� � � � �V�/�/��3�P��L��� ��K����&*��{�)��N�*�*�:�:�!�!�.�.������� � �/� �"2�15��� #� �+/�/��/���/� ��/��/� /���/� �/���/��)�/�� �/�>��*���*�$� �[�[������@� �37��%��%���%��1� %� ��%�� � %�����*�$�$ !�L+�"��!���!���9���9� ��,���,���>���>���-���-� '�&� �%*� �� ��� ��� � �#� �� � �( �$�#'�37�_$��� $�#�'+�_$��_$���_$�� � _$� �1�_$���_$���_$���_$��!%�_$�� �_$�J�#'�37�L��L���L�� � L� �1�L�� � L�&<� �<��<r���r���c�������������������������e�Zd�ZU�dZed���ZdZded<���dZded<���dZ ded<���dZ d ed <���dZded<���dZded <���dZ ded<���dZded<���dZded<��� �deddej$������������������ddddddddddddddddd� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �d��fd�Z � � � � � � � � �d � � � � � � � � � � � � � � � � � � �dd�Zdd�Zdd�Z��xZS�)�HTTPSConnectionz� Many of the parameters to this constructor are passed to the underlying SSL socket by means of :py:func:`urllib3.util.ssl_wrap_socket`. r:���N�int | str | None� cert_reqsrI����ca_certs�ca_cert_dir�None | str | bytes�ca_cert_data�ssl_versionrK����ssl_minimum_version�ssl_maximum_versionr.���z!typing.Callable[..., None] | None�_connect_callbackrN���)r���rE���rC���rF���rO���rP���r���assert_hostnamer.����server_hostname�ssl_contextr��r��r ��r��r ��r��� cert_file�key_file�key_passwordc���������� ������������t����������|����||||||||���������||�_��������||�_��������||�_��������| |�_��������||�_��������| |�_��������||�_��������||�_ ��������||�_ ��������||�_��������|xr�t��������j������������������j������������������|�������|�_��������|xr�t��������j������������������j������������������|�������|�_��������||�_��������| �.|�j �������������������|�j ������������������j$������������������} nt'��������d��������} | |�_��������d�|�_��������y�)N)rS���r���rE���rC���rF���rO���rP���)rT���rU���r��r��r��r��r��r��r.���r��r��r ���os�path� expanduserr��r��r ���verify_moder1���r��r��)rW���rR���rS���r���rE���rC���rF���rO���rP���r��r��r.���r��r��r��r��r ��r��r ��r��r��r��r��rX���s��� �r���rU���zHTTPSConnection.__init__6��s��������8� ������)��)��%�� �� ��!�� �"���(���&���.���.���"4���&���#6�� �#6�� � �A�R�W�W�%7�%7��%A�� �&�J�2�7�7�+=�+=�k�+J���(���������+� �,�,�8�8� �-�d�3� �"���!%��r���c ���������������������t��������j������������������dt��������d���������|�.|�j�������������������|�j������������������j������������������}nt��������d�������}||�_��������||�_��������||�_��������||�_ ��������||�_ ��������||�_��������|xr�t��������j������������������j������������������|�������|�_��������|xr�t��������j������������������j������������������|�������|�_��������| |�_��������y)zX This method should only be called once, before the connection is used. z�HTTPSConnection.set_cert() is deprecated and will be removed in urllib3 v2.1.0. Instead provide the parameters to the HTTPSConnection constructor.r����r����N)r����r����r����r��r��r1���r��r��r��r��r��r.���r��r��r��r��r��r ��) rW���r��r��r��r��r��r��r.���r��r ��s ��� r����set_certzHTTPSConnection.set_certt��s�������� � � � +��(�� �������+� �,�,�8�8� �-�d�3� � �� �"���"���(���.���"4��� �A�R�W�W�%7�%7��%A�� �&�J�2�7�7�+=�+=�k�+J���(��r���c�����������������4����|�j��������������������%|�j�������������������|�j�������������������}|�j������������������}n|�j������������������}|�j������������������}dt��������j ������������������v�rt ��������j������������������||��������}nd}|�j�������������������&|�j������������������dt��������j��������������������������|��������� �|�j��������������������������x|�_��������}|�j������������������}d}|�j������������������r�|�j������������������dk(��r&|�j������������������|�j������������������|�������x|�_��������}d}n|�j������������������dk(��rd|�_��������d|�_��������|�j%���������������������������t'��������j(������������������t*��������|�j��������������������������}|�j,�������������������|�j,������������������}t.��������j0������������������j3��������������������������t4��������k��}|r"t7��������j8������������������d t4����������d �t:����������������|j=������������������d�������}t?��������di�d|�d |�j@�������������������d|�jB�������������������d|�jD�������������������d|�jF�������������������d|�jH�������������������d|�jJ�������������������d|�jL�������������������d|�jN�������������������d|�jP�������������������d|�jR�������������������d|�d|�jT�������������������d|�d|�jV�������������������d|�jX��������������������} | jZ������������������|�_��������|�5| jZ������������������ja��������������������������dk(��} t ��������j^������������������||| ���������|�jb������������������rd|�_2��������n| jd������������������|�_2��������tg��������|�jh�������������������������|�_��������|�j"������������������r|�j �������������������| jd������������������|�_��������y�y�y�#�t\��������$�rN�|�j�������������������&|�j������������������dt��������j��������������������������|���������|�t ��������j^������������������||d������������w�xY�w)N�h2)rR���rS���Fzbefore connect)� thread_id�target_supports_http2r:���Tr9���zSystem time is way off (before z5). This will probably lead to SSL verification errorsrZ���ri���r��r��r��r ��r��r��r ��r��r��r��r��r��� tls_in_tlsr��r.���zafter connect failure)rR���rS����supports_http2r���)5rJ���rL���rR���rS���r,����ALPN_PROTOCOLS�http2_probe�acquire_and_getr��� threading� get_identrk���ri���r����rM����_connect_tls_proxyrA���rG���r�����typing�castr����r���datetime�date�today�RECENT_DATEr����r����r(���r\����#_ssl_wrap_socket_and_match_hostnamer��r��r��r ��r��r��r ��r��r��r��r��r��r.���rc���� BaseException�set_and_release�selected_alpn_protocolr����r@���r?���rO���)rW����probe_http2_host�probe_http2_portr��ri���r��r ���is_time_off�server_hostname_rm_dot�sock_and_verifiedr!��s��� r���r����zHTTPSConnection.connect���s������ ����(�T�->�->�-J�#�0�0��#�0�0��#�y�y��#�y�y����4�&�&�&�$/�$?�$?�%�,<�%�!��%*�!��!�!�-��"�"� �#�-�-�/�&;�� #�� �I �#�~�~�/�/�D�I��#'�9�9�O��J���&�&��&�&�'�1�'+�'>�'>�t�y�y�$�'O�O�D�I��!%�J��(�(�F�2�-2�D�*��04��,�����"(�+�+�c�4�3D�3D�"E���#�#�/�"&�"6�"6��"�-�-�-�-�/�+�=�K��� � �9�+���G:��:��&���&5�%;�%;�C�%@�"� C��!��!��.�.�!��!�,�,�!��%)�$<�$<� !� �%)�$<�$<�!����� !��!�,�,�!��"�.�.�!���.�.�!�����!��"�.�.�!��!7�!��!�,�,�!��&�!��!%� 4� 4�!� �$(�#:�#:�!!��$�*�0�0�D�I�(�!�(�.�5�5�L�L�N�RV�V�N��'�'�%�%�-� ���#�#�$�D��0�<�<�D�� �(,�D�J�J�'7��$���'�'�D�,B�,B�,J�%6�%B�%B�D�"��-K�'��Q��� ��%�%�1��&�&�+�'�1�1�3�*?��'����%�,��+�+�)�0@�QU��� � �s����)G5M����ANc���������������������t��������j������������������t��������|�j�������������������������}|j������������������}t��������|f|�j������������������|�j������������������|�j������������������|�j������������������|�j������������������|�j������������������|�j������������������|||j������������������|j������������������ddddd��}|j������������������|�_��������|j"������������������S�)zY Establish a TLS connection to the proxy using the provided SSL context. NF)r��r��r��r ��r��r��r ��r��r��r��r.���r��r��r��r ��)r(��r)��r���rP���r��r.��r��r��r��r ��r��r��r ��r��r.���r@���rA���rc���)rW����hostnameri���rP���r��r6��s��� r���r'��z"HTTPSConnection._connect_tls_proxy&��s������� ��{�{�;��0A�0A�B��"�.�.��?�� ��n�n��(�(� $� 8� 8� $� 8� 8��]�]��(�(��*�*�$�#�(�8�8�+�>�>�����# ��&�"3�!>�!>��� �'�'�'r���r����).rR���r����rS���rK���r���r���rE���rD���rC���rB���rF���r����rO���r����rP���r����r��r��r���"None | str | typing.Literal[False]r.���rI���r��rI���r���ssl.SSLContext | Noner��rI���r��rI���r ��r ��r��rK���r ��rK���r��r��r��rI���r��rI���r��rI���r����r����) NNNNNNNNN)r��rI���r��rI���r��r��r��rI���r��rI���r��r9��r.���rI���r��rI���r ��r ��r����r����r����)r8��r����ri���r����r����z ssl.SSLSocket)r���r���r���r����r����r=���r��r����r��r��r ��r��r��r ��r.���r��r���r���r>���rU���r��r����r'��r��r��s���@r���r��r��$��sB������� �"�'�*�L�"&�I��&��H�j��"�K��"�'+�L�$�+�$(�K�!�(�&*���*�&*���*�%)�� �)�;?��8�?� � �<&� �"2�15��� �1�1� �+/�&*�>B�)-�&*�-1�#�"&�+/�*.�*.�(,� $�#�#'�5<&��<&���<&� ��<&��/� <&���<&� �<&���<&��)�<&��$�<&��<�<&��'�<&� �$�!<&�"�+�#<&�$��%<&�&� �'<&�(�)�)<&�*�(�+<&�,�(�-<&�.�&�/<&�0��1<&�2��3<&�4�!�5<&�6� �7<&�@� $� $�&*�#'�#�>B�)-�"&�+/�')��')���')��$� ')� �!�')��� ')��<�')��'�')�� �')��)�')�� �')�RGC�R(r���r��c�������������������&�����e�Zd�ZU�dZded<���ded<���y)�_WrappedAndVerifiedSocketz[ Wrapped socket and whether the connection is verified after the TLS handshake zssl.SSLSocket | SSLTransportrc���r?���r@���N)r���r���r���r����r����r���r���r���r<��r<��D��s������� � )�(��r���r<��F)r ��c����������������d����d}|�$d}t��������t��������|�������||t��������|���������������}n|}t��������|�������|_��������|s&|s$|du�s t��������j ������������������st��������j������������������sd|_��������|s"| s | s|rt��������|d�������r|j���������������������������| �6| j������������������d�������}d|v�r|d|j������������������d��������}t��������|�������r|} t��������|�||||| | | ||�� ������} �|rt��������|j������������������d� �������|��������nd|j������������������t ��������j"������������������k7��rG|j������������������s;|dur7|j��������������������������}|rd}nt%��������|d d�������xs�d}t'��������||xs�| |��������t)��������||j������������������t ��������j*������������������k(��xs�t-��������|���������������S�#�t.��������$�r�|j1�����������������������������w�xY�w)a2��Logic for constructing an SSLContext from all TLS parameters, passing that down into ssl_wrap_socket, and then doing certificate verification either via hostname or fingerprint. This function exists to guarantee that both proxies and targets have the same behavior when connecting via TLS. FNT)r��r��r ��r���load_default_certs�[]�%) ri����keyfile�certfiler��r��r��r ��r��r��r ��)�binary_form�hostname_checks_common_name)rc���r@���)r/���r2���r1���r��r,����IS_PYOPENSSL�HAS_NEVER_CHECK_COMMON_NAME�check_hostname�hasattrr>��r�����rfindr0���r3����_assert_fingerprint�getpeercert�ssl� CERT_NONEr�����_match_hostnamer<��� CERT_REQUIREDr?���r/��r����)ri���r��r��r��r ��r��r��r��r��r��r ��r��r.���r��r��r ���default_ssl_context�context� normalized�ssl_sock�certrD��s��� r���r.��r.��N��s������0� ����"��(�+�K�8� 3� 3�'� �2� �����+�I�6�G�� � ���e�#������/�/�!&���� �����G�1�2��"�"�$� ��"�$�*�*�4�0� ��*��#�$;�j�&6�&6�s�&;�<�J�� �#�(�O�� ���!���!�'����H�#����$�$��$�6�8J� �� ���3�=�=�0��*�*��u�,�-5�-A�-A�-C�D� �#�.3�+���G�%B�E�J�S�e��,�� ���2�?�+� ��)���+�+�s�/@�/@�@��(��&�'� �� �� �������� ��s ����B7F��F/c����������������������|j������������������d�������}t��������|�������r|} �t��������|�||��������y�#�t��������$�r$}t��������j������������������d||���������|�|_����������d�}~ww�xY�w)Nr?��z@Certificate did not match expected hostname: %s. Certificate: %s)r����r0���r5���r4���r����r����� _peer_cert)rT���asserted_hostnamerD���stripped_hostnamerj���s��� r���rN��rN�����sh�������*�/�/��5���%�&�-����t�.�0K�L���� ����N��� ����� �� �s���� .�� A�A�Ac�����������������������dj������������������t��������j������������������dt��������|��������j ����������������������������������������}d|v�xs �d|v�xs�d|v�}d}t��������d|r|dk(��r|nd ���|��������}|�|_��������|S�) Nrx���z[^a-z]zwrong version numberzunknown protocolzrecord layer failurez�. Your proxy appears to only use HTTP and not HTTPS, try changing your proxy URL to be HTTP. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#https-proxy-error-http-proxyzUnable to connect to proxyr:���r����)r�����re�splitr����r����r'���� __cause__)�err�proxy_scheme�error_normalized�is_likely_http_proxy�http_proxy_warning�new_errs��� r����_wrap_proxy_errorrc�����s���������x�x�����3�s�8�>�>�3C� D�E���"2�2�� 6��!1�1� 6�!�%5�5��� (����� $�!5�,�'�:Q��WY� Z� \���G� ��G���Nr���c�����������������������dt������������S�)Nzpython-urllib3/r!���r���r���r���r����r�������s������ �[�M�*�*r���c������������������������e�Zd�ZdZy)�DummyConnectionz-Used to detect a failed ConnectionCls import.N)r���r���r���r����r���r���r���rf��rf����s������7r���rf��c����������������������t��������|�t���������������rdnd}t��������||�j������������������|�j������������������|��������j ������������������S�)zUReturns the URL from a given connection. This is mainly used for testing and logging.r:���r9���)rp���rR���rS���r��)r����r��r6���rR���rS���r����)�connr��rp���s��� r���r����r���� ��s3������ �#�4��9�W�v�F��f�4�9�9�4�9�9�4�H�L�L�Lr���)"ri���r����r���None | str | intr��ri��r��rK���r ��rK���r��rI���r��rI���r��rI���r��rI���r��rI���r ��r ��r��r9��r.���rI���r��rI���r��r:��r ��r?���r����r<��)F)rT��z_TYPE_PEER_CERT_RET_DICT | NonerW��r����rD��r?���r����r����)r]��� Exceptionr^��rI���r����r'���r����r����)rh��z HTTPConnection | HTTPSConnectionr��rI���r����r����)c� __future__r���r*���http.clientr9����loggingr��rZ��rc���rg���r%��r(��r����r����_HTTPConnectionr���r���r���re���� TYPE_CHECKINGr����r���� util.ssl_r����util.ssltransportr ����_collectionsr����http2r���r#��� util.responser����util.timeoutr���r���r���� util.utilr���� util.waitr���rL���SSLErrorr����ImportError�AttributeErrorr/���_base_connectionr���r���r ����_versionr"���� exceptionsr#���r$���r%���r&���r'���r(����utilr)���r*���r+���r,����util.requestr-���r.���rJ��r/���r0���r1���r2���r3����util.ssl_match_hostnamer4���r5����util.urlr6����ConnectionError�BrokenPipeError� getLoggerr���r����r����r+��r-���compiler����r��� NamedTupler<��r.��rN��rc��r����rf���VerifiedHTTPSConnectionr����r���r���r����<module>r������s������"�������� �� �� �� ���� ����9��6��(��+� ���&�3�/��(��'��0��B��B����$� ���<�<�L��)��8��B��!�����C��B��(��@�����F����"��!����g����!���s�+����h�m�m�D�!�Q�'��&�B�J�J�'E�F���O�_��O�d](�n��](�@ �� 1� 1���6��#z� �z�� �z��"� z� �$�z��$� z���z���z���z���z���z��%�z��8�z��#�z�� �z� �'�!z�"��#z�$��%z�@�).�� )�����"&��� � �4�2+�8��8���%�O��*����@D�M� *�M�2<�M��M��W� �^�$�� � �C� �}�� � �s����F?��?G�G