Skip to content

Commit 514b91e

Browse files
Update the snippet to have the correct gRPC certs
1 parent 5dd162d commit 514b91e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

snippet.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99

1010
# Check for gRPC certificates
1111
if not (Path(Path.cwd().absolute().anchor) / 'usr' / 'share' / 'grpc' / 'roots.pem').exists():
12-
env_name = 'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'
12+
env_name = "GRPC_DEFAULT_SSL_ROOTS_FILE_PATH"
1313
if env_name not in os.environ or not Path(os.environ[env_name]).exists():
14-
tls_root_certs = Path(tempfile.gettempdir()) / 'roots.pem'
14+
tls_root_certs = Path(tempfile.gettempdir()) / "isrgrootx1.pem"
1515
if not Path(tls_root_certs).exists():
16-
print('Downloading gRPC certificates')
1716
ssl._create_default_https_context = ssl._create_unverified_context
18-
urllib.request.urlretrieve('https://pki.google.com/roots.pem', str(tls_root_certs))
17+
urllib.request.urlretrieve("https://letsencrypt.org/certs/isrgrootx1.pem", str(tls_root_certs))
1918
os.environ[env_name] = str(tls_root_certs)
2019

2120
client = flight.connect('grpc+tls://flight.spiceai.io')

0 commit comments

Comments
 (0)