equal
deleted
inserted
replaced
539 self.sock = _ssl_wrap_socket(sock, self.key_file, |
539 self.sock = _ssl_wrap_socket(sock, self.key_file, |
540 self.cert_file, cert_reqs=CERT_REQUIRED, |
540 self.cert_file, cert_reqs=CERT_REQUIRED, |
541 ca_certs=cacerts) |
541 ca_certs=cacerts) |
542 msg = _verifycert(self.sock.getpeercert(), self.host) |
542 msg = _verifycert(self.sock.getpeercert(), self.host) |
543 if msg: |
543 if msg: |
544 raise util.Abort(_('%s certificate error: %s') % |
544 raise util.Abort(_('%s certificate error: %s ' |
545 (self.host, msg)) |
545 '(use --insecure to connect ' |
|
546 'insecurely)') % (self.host, msg)) |
546 self.ui.debug('%s certificate successfully verified\n' % |
547 self.ui.debug('%s certificate successfully verified\n' % |
547 self.host) |
548 self.host) |
548 else: |
549 else: |
549 httplib.HTTPSConnection.connect(self) |
550 httplib.HTTPSConnection.connect(self) |
550 if hasattr(self.sock, 'getpeercert'): |
551 if hasattr(self.sock, 'getpeercert'): |