def system_path():
 ca_path = None
 paths = [u'/usr/lib/ssl/certs/ca-certificates.crt', u'/etc/ssl/certs/ca-certificates.crt', u'/etc/ssl/certs/ca-bundle.crt', u'/etc/pki/tls/certs/ca-bundle.crt', u'/etc/ssl/ca-bundle.pem', u'/usr/local/share/certs/ca-root-nss.crt', u'/etc/ssl/cert.pem']
 if (u'SSL_CERT_FILE' in os.environ):
  paths.insert(0, os.environ[u'SSL_CERT_FILE'])
 for path in paths:
  if (os.path.exists(path) and (os.path.getsize(path) > 0)):
   ca_path = path
   break
 if (not ca_path):
  raise OSError(pretty_message(u'\n            Unable to find a CA certs bundle in common locations - try\n            setting the SSL_CERT_FILE environmental variable\n            '))
 return ca_path

def system_path ( ) : ca_path = None paths = [ u'/usr/lib/ssl/certs/ca-certificates.crt' , u'/etc/ssl/certs/ca-certificates.crt' , u'/etc/ssl/certs/ca-bundle.crt' , u'/etc/pki/tls/certs/ca-bundle.crt' , u'/etc/ssl/ca-bundle.pem' , u'/usr/local/share/certs/ca-root-nss.crt' , u'/etc/ssl/cert.pem' ] if ( u'SSL_CERT_FILE' in os . environ ) : paths . insert ( 0 , os . environ [ u'SSL_CERT_FILE' ] ) for path in paths : if ( os . path . exists ( path ) and ( os . path . getsize ( path ) > 0 ) ) : ca_path = path break if ( not ca_path ) : raise OSError ( pretty_message ( u'\n            Unable to find a CA certs bundle in common locations - try\n            setting the SSL_CERT_FILE environmental variable\n            ' ) ) return ca_path
tries to find a ca certs bundle in common locations :raises: oserror - when no valid ca certs bundle was found on the filesystem :return: the full filesystem path to a ca certs bundle file .