Add gentoo cert path for OS-DEFAULT

Signed-off-by: Espen Henriksen <dev@henriksen.is>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Espen Henriksen 2016-09-20 22:31:48 +02:00 committed by Nicolas Sebrecht
parent c287ecb7cc
commit 4ee1518b64

View File

@ -7,7 +7,7 @@ import os
# Each dictionary value is either string or some iterable. # Each dictionary value is either string or some iterable.
# #
# For the former we will just return the value, for an iterable # For the former we will just return the value, for an iterable
# we will walk through the values and will return the first # we will walk through the values and will return the first
# one that corresponds to the existing file. # one that corresponds to the existing file.
@ -21,6 +21,7 @@ __DEF_OS_LOCATIONS = {
], ],
'linux-ubuntu': '/etc/ssl/certs/ca-certificates.crt', 'linux-ubuntu': '/etc/ssl/certs/ca-certificates.crt',
'linux-debian': '/etc/ssl/certs/ca-certificates.crt', 'linux-debian': '/etc/ssl/certs/ca-certificates.crt',
'linux-gentoo': '/etc/ssl/certs/ca-certificates.crt',
'linux-fedora': '/etc/pki/tls/certs/ca-bundle.crt', 'linux-fedora': '/etc/pki/tls/certs/ca-bundle.crt',
'linux-redhat': '/etc/pki/tls/certs/ca-bundle.crt', 'linux-redhat': '/etc/pki/tls/certs/ca-bundle.crt',
'linux-suse': '/etc/ssl/ca-bundle.pem', 'linux-suse': '/etc/ssl/ca-bundle.pem',
@ -43,13 +44,13 @@ def get_os_name():
if OS.startswith('linux'): if OS.startswith('linux'):
DISTRO = platform.linux_distribution()[0] DISTRO = platform.linux_distribution()[0]
if DISTRO: if DISTRO:
OS = OS + "-%s" % DISTRO.lower() OS = OS + "-%s" % DISTRO.split()[0].lower()
return OS return OS
def get_os_sslcertfile_searchpath(): def get_os_sslcertfile_searchpath():
"""Returns search path for CA bundle for the current OS. """Returns search path for CA bundle for the current OS.
We will return an iterable even if configuration has just We will return an iterable even if configuration has just
a single value: it is easier for our callers to be sure a single value: it is easier for our callers to be sure
that they can iterate over result. that they can iterate over result.