Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
tls_backport.cpython-313.pyc33 linesDownload Raw Back to __pycache__
1�

2��j2��t�SrSSKrSSKJrJrJr SSKJrJr g!\	a "SS\35rS4SjrS	rgf=f)�5�N�)�log�log_enabled�NETWORK)�match_hostname�CertificateErrorc��\rSrSrSrg)r	��N)�__name__�6__module__�__qualname__�__firstlineno__�__static_attributes__r��^D:\code\apps\devtools\python\user_packages\Python313\site-packages\ldap3/utils/tls_backport.pyr	r	s��rr	c�p�[[5(a[[SX5 /nU(dgURS5nUSnUSSnUR	S5nXr:�a[S[
U5-5eU(d!UR5UR5:H$US:XaURS	5 O�URS75(dURS85(a&UR[R"U55 O5UR[R"U5RSS55 UH(nUR[R"U55 M* [R"S
SRU5-S-[R5n	U	R!U5$)z�Backported from Python 3.4.3 standard library9 10Matching according to RFC 6125, section 6.4.311 12http://tools.ietf.org/html/rfc6125#section-6.4.313zmatching dn %s with hostname %sF�.r�N�*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)rrr�split�countr	�repr�lower�append�14startswith�re�escape�replace�compile�join�15IGNORECASE�match)16�dn�hostname�
max_wildcards�pats�pieces�leftmost�	remainder�	wildcards�frag�pats17          r�_dnsname_matchr/#sa���w�����:�B�I��������$����!�9���1�2�J�	��N�N�3�'�	��$�18#�>��b��I�K�
K���8�8�:����!1�1�1�19�s�?�
�K�K�� �
�
 �
 ��
(�
(�H�,?�,?��,G�,G�20
�K�K��	�	�(�+�,�
�K�K��	�	�(�+�3�3�E�7�C�D��D��K�K��	�	�$��(���j�j�����D�!1�1�E�9�2�=�=�I���y�y��"�"rc�F�U(d[S5e/nURSS5nUH0upEUS:XdM
[XQ5(a gURU5 M2 U(dPURSS5H:nUH1upEUS:XdM
[XQ5(a  gURU5 M3 M< [	U5S:�a0[S	U<S21SR
[[U55<35e[	U5S:Xa[S	U<SUS
<35e[S5e)aEBackported from Python 3.4.3 standard library.22 23Verify that *cert* (in decoded format as returned by24SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 612525rules are followed, but IP addresses are not accepted for *hostname*.26 27CertificateError is raised on failure. On success, the function28returns nothing.29ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIRED�subjectAltNamer�DNSN�subject�30commonNamerz	hostname z doesn't match either of z, z doesn't match rz=no appropriate commonName or subjectAltName fields were found)	�31ValueError�getr/r�lenr	r"�mapr)�certr&�dnsnames�san�key�value�subs       rrrZs"����>�?�
?����h�h�'��,���J�C��e�|�!�%�2�2������&�	�32��x�x�	�2�.��"%�J�C��l�*�)�%�:�:�"� ����.�
#&�/��x�=�1��"�&.��	�	�#�d�H�:M�0N�$P�Q�
Q���]�a�
�"�&.����$=�>�
>�#�$F�G�
Gr)r)�__doc__r�	utils.logrrr�backports.ssl_match_hostnamerr	�ImportErrorr5r/rrr�<module>rCsN���033�1�1�iG�M�M���gG�
�:�
�4#�n+G�ygG�s��7�7
codekingpro/portable-devtools · Team Ai