6432: Python SDK can find and use CA certs on Red Hat.
[arvados.git] / sdk / python / arvados / api.py
index 8294df33f57ac6e76ad80dc19769cc9a4981c0ad..086487aa09714e2873e2b49ac7cafff222ea0d1b 100644 (file)
@@ -158,11 +158,7 @@ def api(version=None, cache=True, host=None, token=None, insecure=False, **kwarg
             'https://%s/discovery/v1/apis/{api}/{apiVersion}/rest' % (host,))
 
     if 'http' not in kwargs:
-        http_kwargs = {}
-        # Prefer system's CA certificates (if available) over httplib2's.
-        certs_path = '/etc/ssl/certs/ca-certificates.crt'
-        if os.path.exists(certs_path):
-            http_kwargs['ca_certs'] = certs_path
+        http_kwargs = {'ca_certs': util.ca_certs_path()}
         if cache:
             http_kwargs['cache'] = http_cache('discovery')
         if insecure: