mercurial/sslutil.py
branchstable
changeset 29460 a7d1532b26a1
parent 29452 26a5d605b868
child 29501 be68a4445041
equal deleted inserted replaced
29454:ddbff1435e7b 29460:a7d1532b26a1
   234         if key == 'DNS':
   234         if key == 'DNS':
   235             try:
   235             try:
   236                 if _dnsnamematch(value, hostname):
   236                 if _dnsnamematch(value, hostname):
   237                     return
   237                     return
   238             except wildcarderror as e:
   238             except wildcarderror as e:
   239                 return e.message
   239                 return e.args[0]
   240 
   240 
   241             dnsnames.append(value)
   241             dnsnames.append(value)
   242 
   242 
   243     if not dnsnames:
   243     if not dnsnames:
   244         # The subject is only checked when there is no DNS in subjectAltName.
   244         # The subject is only checked when there is no DNS in subjectAltName.
   255 
   255 
   256                     try:
   256                     try:
   257                         if _dnsnamematch(value, hostname):
   257                         if _dnsnamematch(value, hostname):
   258                             return
   258                             return
   259                     except wildcarderror as e:
   259                     except wildcarderror as e:
   260                         return e.message
   260                         return e.args[0]
   261 
   261 
   262                     dnsnames.append(value)
   262                     dnsnames.append(value)
   263 
   263 
   264     if len(dnsnames) > 1:
   264     if len(dnsnames) > 1:
   265         return _('certificate is for %s') % ', '.join(dnsnames)
   265         return _('certificate is for %s') % ', '.join(dnsnames)