diff --git a/pygeoutils/__init__.py b/pygeoutils/__init__.py index 1fe04f2..682fb12 100644 --- a/pygeoutils/__init__.py +++ b/pygeoutils/__init__.py @@ -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 ( @@ -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: