Commit c9b7402a authored by Michael Catanzaro's avatar Michael Catanzaro

Improve the script that finds the certificate store

parent 4b31aba3
#!/usr/bin/env python3
import errno
import os
import sys
for arg in sys.argv[1:]:
if os.path.isfile(arg):
sys.stdout.write(arg)
sys.exit(0)
sys.exit(errno.ENOENT)
#!/usr/bin/env python3
import errno
import os
import sys
locations = [ '/etc/pki/tls/certs/ca-bundle.crt',
'/etc/ssl/certs/ca-certificates.crt',
'/etc/ssl/ca-bundle.pem'
]
if len(sys.argv) > 1:
locations.insert(0, sys.argv[1])
for location in locations:
if os.path.isfile(location):
sys.stdout.write(location)
sys.exit(0)
sys.exit(errno.ENOENT)
......@@ -76,15 +76,8 @@ if enable_tls_support
pkcs_support = []
msg = 'location of system Certificate Authority list: '
cert_locations = [
get_option('ca_certificates_path'),
'/etc/pki/tls/certs/ca-bundle.crt',
'/etc/ssl/certs/ca-certificates.crt',
'/etc/ssl/ca-bundle.pem'
]
res = run_command(find_program('check_certs.py'), cert_locations)
assert(res.returncode() == 0, msg + ' could not find any TLS certificate. Use -Dca_certificates_path=PATH to set, or -Dtls_support=no to disable')
res = run_command(find_program('find-ca-certificates'), get_option('ca_certificates_path'))
assert(res.returncode() == 0, msg + ' could not find any CA certificate store. Use -Dca_certificates_path=PATH to set, or -Dtls_support=no to disable')
ca_certificates_path = res.stdout().strip()
message(msg + ca_certificates_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment