<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
ó
¿öYc           @@  sW   d  Z  d d l m Z d d l Z d Z d e f d „  ƒ  YZ d d „ Z d	 „  Z d S(
   sH   The match_hostname() function from Python 3.2, essential when using SSL.i    (   t   absolute_importNs   3.2.2t   CertificateErrorc           B@  s   e  Z RS(    (   t   __name__t
   __module__(    (    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/utils/ssl_match_hostname.pyR   
   s   i   c   	      C@  sL  g  } |  s t  S|  j d ƒ } | d } | j d ƒ } | | k r] t d t |  ƒ ƒ ‚ n  | sy |  j ƒ  | j ƒ  k S| d k r• | j d ƒ nY | j d ƒ s³ | j d ƒ rÌ | j t j	 | ƒ ƒ n" | j t j	 | ƒ j
 d d ƒ ƒ x( | d	 D] } | j t j	 | ƒ ƒ qù Wt j d
 d j | ƒ d t j ƒ } | j | ƒ S(   sh   Matching according to RFC 6125, section 6.4.3

    http://tools.ietf.org/html/rfc6125#section-6.4.3
    t   .i    t   *s,   too many wildcards in certificate DNS name: s   [^.]+s   xn--s   \*s   [^.]*i   s   \As   \.s   \Z(   t   Falset   splitt   countR   t   reprt   lowert   appendt
   startswitht   ret   escapet   replacet   compilet   joint
   IGNORECASEt   match(	   t   dnt   hostnamet   max_wildcardst   patst   partst   leftmostt	   wildcardst   fragt   pat(    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/utils/ssl_match_hostname.pyt   _dnsname_match   s(    
"&c         C@  s[  |  s t  d ƒ ‚ n  g  } |  j d d ƒ } xC | D]; \ } } | d k r4 t | | ƒ r_ d S| j | ƒ q4 q4 W| sß xc |  j d d ƒ D]L } xC | D]; \ } } | d k r™ t | | ƒ rÄ d S| j | ƒ q™ q™ WqŒ Wn  t | ƒ d k rt d | d	 j t t | ƒ ƒ f ƒ ‚ n; t | ƒ d k rKt d
 | | d f ƒ ‚ n t d ƒ ‚ d S(   s)  Verify that *cert* (in decoded format as returned by
    SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
    rules are followed, but IP addresses are not accepted for *hostname*.

    CertificateError is raised on failure. On success, the function
    returns nothing.
    s   empty or no certificatet   subjectAltNamet   DNSNt   subjectt
   commonNamei   s&   hostname %r doesn't match either of %ss   , s   hostname %r doesn't match %ri    s=   no appropriate commonName or subjectAltName fields were found(    (    (	   t
   ValueErrort   getR   R   t   lenR   R   t   mapR	   (   t   certR   t   dnsnamest   sant   keyt   valuet   sub(    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/utils/ssl_match_hostname.pyt   match_hostname@   s2    %(	   t   __doc__t
   __future__R    R   t   __version__R"   R   R   R,   (    (    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/utils/ssl_match_hostname.pyt   <module>   s   2