equal
deleted
inserted
replaced
636 for sub in cert.get('subject', []): |
636 for sub in cert.get('subject', []): |
637 for key, value in sub: |
637 for key, value in sub: |
638 # According to RFC 2818 the most specific Common Name must |
638 # According to RFC 2818 the most specific Common Name must |
639 # be used. |
639 # be used. |
640 if key == 'commonName': |
640 if key == 'commonName': |
641 # 'subject' entries are unicide. |
641 # 'subject' entries are unicode. |
642 try: |
642 try: |
643 value = value.encode('ascii') |
643 value = value.encode('ascii') |
644 except UnicodeEncodeError: |
644 except UnicodeEncodeError: |
645 return _('IDN in certificate not supported') |
645 return _('IDN in certificate not supported') |
646 |
646 |
762 'how to configure Mercurial to avoid this message)\n')) |
762 'how to configure Mercurial to avoid this message)\n')) |
763 |
763 |
764 return None |
764 return None |
765 |
765 |
766 def validatesocket(sock): |
766 def validatesocket(sock): |
767 """Validate a socket meets security requiremnets. |
767 """Validate a socket meets security requirements. |
768 |
768 |
769 The passed socket must have been created with ``wrapsocket()``. |
769 The passed socket must have been created with ``wrapsocket()``. |
770 """ |
770 """ |
771 host = sock._hgstate['hostname'] |
771 host = sock._hgstate['hostname'] |
772 ui = sock._hgstate['ui'] |
772 ui = sock._hgstate['ui'] |