#NEWLINE# def get_ca_bundle( opts = None ) : #NEWLINE# #INDENT# '\n    Return the location of the ca bundle file. See the following article:\n\n        http://tinyurl.com/k7rx42a\n    ' #NEWLINE# if hasattr ( get_ca_bundle , '__return_value__' ) : #NEWLINE# #INDENT# return get_ca_bundle . __return_value__ #NEWLINE# #UNINDENT# if ( opts is None ) : #NEWLINE# #INDENT# opts = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# opts_bundle = opts . get ( 'ca_bundle' , None ) #NEWLINE# if ( ( opts_bundle is not None ) and os . path . exists ( opts_bundle ) ) : #NEWLINE# #INDENT# return opts_bundle #NEWLINE# #UNINDENT# file_roots = opts . get ( 'file_roots' , { #NEWLINE# #INDENT# 'base' : [ syspaths . SRV_ROOT_DIR ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# for salt_root in file_roots . get ( 'base' , [ ] ) : #NEWLINE# #INDENT# for path in ( 'cacert.pem' , 'ca-bundle.crt' ) : #NEWLINE# #INDENT# cert_path = os . path . join ( salt_root , path ) #NEWLINE# if os . path . exists ( cert_path ) : #NEWLINE# #INDENT# return cert_path #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# locations = ( '/etc/ssl/certs/ca-certificates.crt' , '/etc/pki/tls/certs/ca-bundle.crt' , '/etc/pki/tls/certs/ca-bundle.trust.crt' , '/etc/ssl/certs/ca-bundle.crt' , '/var/lib/ca-certificates/ca-bundle.pem' , '/etc/ssl/cert.pem' ) #NEWLINE# for path in locations : #NEWLINE# #INDENT# if os . path . exists ( path ) : #NEWLINE# #INDENT# return path #NEWLINE# #UNINDENT# #UNINDENT# if ( salt . utils . is_windows ( ) and HAS_CERTIFI ) : #NEWLINE# #INDENT# return certifi . where ( ) #NEWLINE# #UNINDENT# return None