diff --git a/btrdb/conn.py b/btrdb/conn.py index a07c162..bb79f2f 100644 --- a/btrdb/conn.py +++ b/btrdb/conn.py @@ -18,6 +18,7 @@ import os import re import json +import certifi import uuid as uuidlib import grpc @@ -66,10 +67,15 @@ def __init__(self, addrportstr, apikey=None): # certificates but will fail for custom CA certs. Allow the user # to specify a CA bundle via env var to overcome this env_bundle = os.getenv("BTRDB_CA_BUNDLE", "") - os_certs = "/etc/ssl/certs/ca-certificates.crt" + + # certifi certs are provided as part of this package install + # https://github.com/certifi/python-certifi + lib_certs = certifi.where() + ca_bundle = env_bundle + if ca_bundle == "": - ca_bundle = os_certs + ca_bundle = lib_certs try: with open(ca_bundle, "rb") as f: contents = f.read() diff --git a/requirements.txt b/requirements.txt index b12c1a6..0d89f56 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ grpcio-tools>=1.19.0 pytz # Misc libraries -pyyaml \ No newline at end of file +pyyaml +certifi \ No newline at end of file