netcdf-c: ncdump error: SSL connect, curl, oc_open could not read url

I’m in a conda environment on Windows and ncdump is giving me a “could not read url” error (oc_open, SSL connect) when accessing a file on a remote server:

(EQ) PS C:\Users\Codiga_D> ncdump -h http://psl.noaa.gov/thredds/dodsC/Datasets/NARR/monolevel/uwnd.10m.2000.nc
Error:curl error: SSL connect error
curl error details:
Warning:oc_open: Could not read url
C:\Users\Codiga_D\AppData\Local\Continuum\miniconda3\envs\EQ\Library\bin\ncdump.exe: http

Others report success with this operation so the trouble seems to be with my own system. These seem relevant:

(EQ) PS C:\Users\Codiga_D> conda list curl
# packages in environment at C:\Users\Codiga_D\AppData\Local\Continuum\miniconda3\envs\EQ:
#
# Name                    Version                   Build  Channel
curl                      7.83.1               h789b8ee_0    conda-forge
libcurl                   7.83.1               h789b8ee_0    conda-forge

(EQ) PS C:\Users\Codiga_D> conda list certifi
# packages in environment at C:\Users\Codiga_D\AppData\Local\Continuum\miniconda3\envs\EQ:
#
# Name                    Version                   Build  Channel
ca-certificates           2022.6.15            h5b45459_0    conda-forge
certifi                   2022.6.15        py37h03978a9_0    conda-forge

The error first occurred for me using xarray,

import xarray as xr
url = 'http://psl.noaa.gov/thredds/dodsC/Datasets/NARR/monolevel/uwnd.10m.2000.nc'
ds = xr. open_dataset(url)

but has been shown to occur in netcdf4 and ncdump as well.

At least several months ago I did not have this problem. I don’t have details as to all the changes to my system have occurred since then, but one recent change had to do with certificate chains so I was guessing it might be related to that.

These issues might be related? https://github.com/Unidata/netcdf-c/issues/1393 https://github.com/Unidata/netcdf-c/issues/1833 https://github.com/Unidata/netcdf4-python/issues/755 https://github.com/pydata/xarray/issues/4925

Earlier posts I have made on this, with some additional relevant information: https://github.com/pydata/xarray/issues/6766 https://github.com/pydata/xarray/discussions/6742

Thank you in advance.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 43 (3 by maintainers)

Most upvoted comments

I came to this thread because I was having this same issue accessing daymet using xarray in a conda environment (xr.open_dataset(‘https://thredds.daac.ornl.gov/thredds/dodsC/daymet-v4-agg/na.ncml’). Many other OPeNDAP endpoints worked but not daymet.

I’m working on WSL2 Ubuntu 22.04 and getting the same curl and netcdf error as @DanCodigaMWRA was experiencing in his conda example above using both netcdf4 v 1.6.1 and 1.6.0. Finally - 1.5.8 worked.

However, using curl in my terminal outside of my conda env I was able to access the daymet endpoint. Still curious, I added my ssl cert to conda `conda config --set ssl_verify <path/to/cert.crt> and now I can access using netcdf v1.6.1.

adding my experience in case someone else bumps into this thread.