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

Xarray tutorial with custom SSL cert? #251

Open
rsignell opened this issue Apr 11, 2024 · 3 comments
Open

Xarray tutorial with custom SSL cert? #251

rsignell opened this issue Apr 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@rsignell
Copy link

rsignell commented Apr 11, 2024

I'm on a secure NATO system with a custom SSL cert and when I try to load some xarray tutorial data:

import xarray as xr
ds = xr.tutorial.open_dataset("air_temperature").isel(time=slice(0, 100))

I get back:

---------------------------------------------------------------------------
SSLCertVerificationError                  Traceback (most recent call last)
File ~/miniforge3/envs/pangeo/lib/python3.10/site-packages/urllib3/connectionpool.py:703, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    702 # Make the request on the httplib connection object.
--> 703 httplib_response = self._make_request(
    704     conn,

With other packages I can set an environment variable to point to the custom .pem, like:

os.environ['AWS_CA_BUNDLE']='/home/shared/PA-RootCA-Cert-2023-Pub.pem'    # s3
os.environ['REQUESTS_CA_BUNDLE']='/home/shared/PA-RootCA-Cert-2023-Pub.pem'  # requests

but there doesn't seem to be such an environment variable for urllib3?

I see this info in the urlib3 docs about custom SSL, but I'm not sure how I could pass this custom context to the xr.tutorial.open_dataset command.

Does anyone know how to overcome this issue?

@dcherian
Copy link
Contributor

We use pooch: https://www.fatiando.org/pooch/latest/index.html. Perhaps there's something there?

It would be good to add the answer here once we figure this out: https://tutorial.xarray.dev/overview/get-started.html

@scottyhq
Copy link
Contributor

Did you figure out a solution to this @rsignell ?

@scottyhq scottyhq added the bug Something isn't working label May 15, 2024
@rsignell
Copy link
Author

Sadly no. 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants