§ <ˆj ã óL — d Z ddlmZ ddlZdZ G d„ de¦ « Zd d„Zd „ ZdS )zHThe match_hostname() function from Python 3.2, essential when using SSL.é )Úabsolute_importNz3.2.2c ó — e Zd ZdS )ÚCertificateErrorN)Ú__name__Ú __module__Ú__qualname__© ó úU/opt/cloudlinux/venv/lib64/python3.11/site-packages/raven/utils/ssl_match_hostname.pyr r s € € € € € Ø€Dr r é c óh — g }| sdS | d¦ « }|d }| d¦ « }||k rt dt | ¦ « z ¦ « ‚|s*| ¦ « | ¦ « k S |dk r| d¦ « n�| d¦ « s| d¦ « r(| t j |¦ « ¦ « n;| t j |¦ « dd ¦ « ¦ « |d d… D ])}| t j |¦ « ¦ « Œ*t j dd |¦ « z dz t j ¦ « }| |¦ « S )zhMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 Fú.r Ú*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*r Nz\Az\.z\Z)ÚsplitÚcountr ÚreprÚlowerÚappendÚ startswithÚreÚescapeÚreplaceÚcompileÚjoinÚ IGNORECASEÚmatch) ÚdnÚhostnameÚ max_wildcardsÚpatsÚpartsÚleftmostÚ wildcardsÚfragÚpats r Ú_dnsname_matchr&