Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROJ_CURL_CA_BUNDLE global env var not being picked up #3977

Open
brynpickering opened this issue Dec 7, 2023 · 2 comments
Open

PROJ_CURL_CA_BUNDLE global env var not being picked up #3977

brynpickering opened this issue Dec 7, 2023 · 2 comments
Labels

Comments

@brynpickering
Copy link

I only have experience with using PROJ via pyproj, but the issue I raised there (pyproj4/pyproj#1233) seems more appropriate here. Namely, PROJ seems to not be picking up my globally set environment variables when it receives an empty string to proj_context_set_ca_bundle_path.

Example of problem

using pyproj:

from pyproj.network import set_ca_bundle_path, set_network_enabled
from pyproj.transformer import Transformer

set_network_enabled(True)
set_ca_bundle_path()
t = Transformer.from_crs("epsg:27700", "epsg:4326")
print(t.transform(0, 0, None, errcheck=True))

I get the error: transform error: Network error when accessing a remote resource: (Internal Proj Error: Cannot open https://cdn.proj.org/uk_os_OSTN15_NTv2_OSGBtoETRS.tif: SSL certificate problem: unable to get local issuer certificate)

Even though I have both PROJ_CURL_CA_BUNDLE and CURL_CA_BUNDLE set globally on my machine.

Passing the path to my CA bundle explicitly to set_ca_bundle_path (and therefore proj_context_set_ca_bundle_path) works as expected.

Problem description

I have a limited understanding of C, but since it is strongly typed I assume proj_context_set_ca_bundle_path has to receive a string when called. pyproj goes with an empty string to invoke a search through the available environment variables in PROJ and I would expect this to land on the path to my CA bundle.

Environment Information

  • PROJ version (proj): 9.3.0
  • Operation System Information: osx-arm64 (Sonoma v14.1.2)

Installation method

  • conda (conda-forge channel)
@rouault
Copy link
Member

rouault commented Dec 7, 2023

PROJ seems to not be picking up my globally set environment variables when it receives an empty string to proj_context_set_ca_bundle_path.

yes this is intended. If the user calls proj_context_set_ca_bundle_path(), this overrides whatever was set through the environment variables. Probably the fix should be on pyproj4 side to not call proj_context_set_ca_bundle_path() if they are set.

@brynpickering
Copy link
Author

OK, I just tried removing the call to proj_context_set_ca_bundle_path in pyproj initialisation and the SSL certificate problem persists. Does this suggest that PROJ isn't finding the environment variables of its own accord?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants