Skip to content

Commit 39ec946

Browse files
author
Allen Leis
authored
bundles certifi certs as dependency (#10)
1 parent 31b3cb1 commit 39ec946

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

btrdb/conn.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import re
2020
import json
21+
import certifi
2122
import uuid as uuidlib
2223

2324
import grpc
@@ -66,10 +67,15 @@ def __init__(self, addrportstr, apikey=None):
6667
# certificates but will fail for custom CA certs. Allow the user
6768
# to specify a CA bundle via env var to overcome this
6869
env_bundle = os.getenv("BTRDB_CA_BUNDLE", "")
69-
os_certs = "/etc/ssl/certs/ca-certificates.crt"
70+
71+
# certifi certs are provided as part of this package install
72+
# https://github.com/certifi/python-certifi
73+
lib_certs = certifi.where()
74+
7075
ca_bundle = env_bundle
76+
7177
if ca_bundle == "":
72-
ca_bundle = os_certs
78+
ca_bundle = lib_certs
7379
try:
7480
with open(ca_bundle, "rb") as f:
7581
contents = f.read()

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ grpcio-tools>=1.19.0
66
pytz
77

88
# Misc libraries
9-
pyyaml
9+
pyyaml
10+
certifi

0 commit comments

Comments
 (0)