Created
July 18, 2018 22:31
-
-
Save magnuswatn/228957f88cab75f43fa73d4ce36985b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_ca_bundle(): | |
"""Tries to find the platform ca bundle for the system (on linux systems)""" | |
ca_bundles = [ | |
# list taken from https://golang.org/src/crypto/x509/root_linux.go | |
"/etc/ssl/certs/ca-certificates.crt", # Debian/Ubuntu/Gentoo etc. | |
"/etc/pki/tls/certs/ca-bundle.crt", # Fedora/RHEL 6 | |
"/etc/ssl/ca-bundle.pem", # OpenSUSE | |
"/etc/pki/tls/cacert.pem", # OpenELEC | |
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", # CentOS/RHEL 7 | |
] | |
for ca_bundle in ca_bundles: | |
if os.path.isfile(ca_bundle): | |
return ca_bundle | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment