mercurial/url.py
branchstable
changeset 13328 a939f08fae9c
parent 13314 8dc488dfcdb4
child 13329 4e92ad05fe18
equal deleted inserted replaced
13322:c19b9282d3a7 13328:a939f08fae9c
   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'):