def build_ssl_validation_error(hostname, port, paths, exc=None):
 msg = ['Failed to validate the SSL certificate for %s:%s. Make sure your managed systems have a valid CA certificate installed.']
 if (not HAS_SSLCONTEXT):
  msg.append('If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine')
  if (not HAS_URLLIB3_SNI_SUPPORT):
   msg.append('or you can install the `urllib3`, `pyopenssl`, `ndg-httpsclient`, and `pyasn1` python modules')
  msg.append('to perform SNI verification in python >= 2.6.')
 msg.append('You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: %s.')
 if exc:
  msg.append(('The exception msg was: %s.' % to_native(exc)))
 raise SSLValidationError((' '.join(msg) % (hostname, port, ', '.join(paths))))

def build_ssl_validation_error ( hostname , port , paths , exc = None ) : msg = [ 'Failed to validate the SSL certificate for %s:%s. Make sure your managed systems have a valid CA certificate installed.' ] if ( not HAS_SSLCONTEXT ) : msg . append ( 'If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine' ) if ( not HAS_URLLIB3_SNI_SUPPORT ) : msg . append ( 'or you can install the `urllib3`, `pyopenssl`, `ndg-httpsclient`, and `pyasn1` python modules' ) msg . append ( 'to perform SNI verification in python >= 2.6.' ) msg . append ( 'You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: %s.' ) if exc : msg . append ( ( 'The exception msg was: %s.' % to_native ( exc ) ) ) raise SSLValidationError ( ( ' ' . join ( msg ) % ( hostname , port , ', ' . join ( paths ) ) ) )
inteligently build out the sslvalidationerror based on what support you have installed .