python-httplib2/ca_certs_locater.py
Sascha Peilicke f1d9144b77 - Change the mechanism to use system-wide CA certificates:
+ on openSUSE, use the (new) upstream ca_certs_locater mechanism
    and don't ship a private copy of Mozilla's CA certs file
  + on SLES, regenerate cacerts.txt from /etc/ssl/certs when
    httplib2 is installed and/or openssl-certs is installed/updated

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httplib2?expand=0&rev=38
2013-07-03 08:20:25 +00:00

23 lines
726 B
Python

#
# httplib2 system SSL certificate bundle locator for openSUSE / SLES.
# openSUSE has /etc/ssl/ca-bundle.pem (from package ca-certificates) but on
# SLES, it's only individual files (from openssl-certs)
#
# Author: Sascha Peilicke <speilicke@suse.com>
#
def get():
for line in open("/etc/SuSE-release"):
if "SUSE Linux Enterprise Server" in line:
# Python-2.x doesn't support loading from a directory containing
# PEM files, thus we have to use a bundle created by hand (and
# refreshed with updates of either httpli2 or openssl-certs).
return "ca-bundle.pem"
else:
return "/etc/ssl/ca-bundle.pem"
if __name__ == "__main__":
print get()