@ -502,9 +533,14 @@ class SSLValidationHandler(urllib2.BaseHandler):
if'connection refused'instr(e).lower():
raiseConnectionError('Failed to connect to %s:%s.'%(self.hostname,self.port))
else:
raiseSSLValidationError('Failed to validate the SSL certificate for %s:%s. '
'Use validate_certs=False (insecure) or make sure your managed systems have a valid CA certificate installed. '
'Paths checked for this platform: %s'%(self.hostname,self.port,", ".join(paths_checked))
raiseSSLValidationError('Failed to validate the SSL certificate for %s:%s.'
' Make sure your managed systems have a valid CA'
' certificate installed. If the website serving the url'
' uses SNI you need python >= 2.7.9 on your managed'
' machine. You can use validate_certs=False if you do'
' not need to confirm the server\s identity but this is'
' unsafe and not recommended'
' Paths checked for this platform: %s'%(self.hostname,self.port,", ".join(paths_checked))
)
exceptCertificateError:
raiseSSLValidationError("SSL Certificate does not belong to %s. Make sure the url has a certificate that belongs to it or use validate_certs=False (insecure)"%self.hostname)
raiseNoSSLError('SSL validation is not available in your version of python. You can use validate_certs=False, however this is unsafe and not recommended')
ifnotHAS_MATCH_HOSTNAME:
raiseSSLValidationError('Available SSL validation does not check that the certificate matches the hostname. You can install backports.ssl_match_hostname or update your managed machine to python-2.7.9 or newer. You could also use validate_certs=False, however this is unsafe and not recommended')