Skip to content

Commit

Permalink
BUG: Set the path to user provided ssl cert file correctly based on p…
Browse files Browse the repository at this point in the history
  • Loading branch information
Taher Chegini committed Jan 8, 2024
1 parent fcde7aa commit 473178c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pygeoutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Top-level package for PyGeoUtils."""
import os
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path

from pygeoutils._utils import get_gtiff_attrs, get_transform, transform2tuple, xd_write_crs
from pygeoutils.exceptions import (
Expand Down Expand Up @@ -41,6 +43,14 @@
xarray_geomask,
)

cert_path = os.getenv("HYRIVER_SSL_CERT")
if cert_path is not None:
from pyproj.network import set_ca_bundle_path

if not Path(cert_path).exists():
raise FileNotFoundError(cert_path)
set_ca_bundle_path(cert_path)

try:
__version__ = version("pygeoutils")
except PackageNotFoundError:
Expand Down

0 comments on commit 473178c

Please sign in to comment.