U Ê—Re~ ã @ st d Z ddlZddlZzddlZW n ek r8 dZY nX dZG dd„ deƒZddd„Zd d „ Z dd„ Z d d„ ZdS )zJThe match_hostname() function from Python 3.3.3, essential when using SSL.é Nz3.5.0.1c @ s e Zd ZdS )ÚCertificateErrorN)Ú__name__Ú __module__Ú__qualname__© r r úš/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.pyr s r é c C sò g }| sdS | d¡}|d }|dd… }| d¡}||krLtdt| ƒ ƒ‚|s`| ¡ | ¡ kS |dkrt| d¡ n>| d ¡sˆ| d ¡rš| t |¡¡ n| t |¡ d d¡¡ |D ]}| t |¡¡ q¶t dd |¡ d tj¡} | |¡S )zhMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 FÚ.r r NÚ*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)ÚsplitÚcountr ÚreprÚlowerÚappendÚ startswithÚreÚescapeÚreplaceÚcompileÚjoinÚ IGNORECASEÚmatch) ÚdnÚhostnameÚ max_wildcardsÚpatsÚpartsÚleftmostÚ remainderÚ wildcardsÚfragÚpatr r r Ú_dnsname_match s, ÿr" c C s&