-
Notifications
You must be signed in to change notification settings - Fork 262
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
OPeNDAP+HTTPS: certificates not found #2337
Comments
I can't see anything in the libcurl change log: https://curl.se/changes.html |
I'm not sure, but I suspect this change might be on the julia side since other libraries that use curl also need to set this path on Linux.
I should've looked better but it seems this already exists; I tried using these two functions, but got stuck on an assertion error from netcdf:
More details are at Alexander-Barth/NCDatasets.jl#174 |
You should not be using any oc function; they were made internal long ago |
For me (as a user of netcdf in my research work), it is certainly acceptable to manually define this configuration file But as a developer of a julia wrapper, I am a bit worried about all the users hitting this error and not knowing what to do. Some of them will use NetCDF as an indirect dependencies and are not aware that a library down the software stack requires some configuration. The error message seems to indicate that there is a problem with the server certificate. We considered to use the environment variable |
Good point. As a developer, I sometimes forget to take the naive user into account.
You might try it as an experiment to see if it works for your problem. You can set the last two |
Thanks for the tip! I tried The code is here: Which prints
Am I forgetting something, or is it supposed to work like this? |
Thanks @visr, for your test with I had look with the gdb debugger while running
However, when I force
subsequent lookup do find the
(And also OPENDAP over HTTPS works without defining a configuration file) Could it be that Maybe something similar to this? |
With this PR defa153 we can now use the private API |
Thanks for the reminder. I plan to expand that API to a little better |
Unfortunately, I see this failure now when trying this on NetCDF 4.9.0.
It seems that
Maybe I need to call now |
This is windows/mingw, correct? |
This issue is now on Linux (Ubuntu 20.04), also reproduced on CI: https://github.com/Alexander-Barth/NCDatasets.jl/runs/6857358120?check_suite_focus=true It might be also present on other platforms, but I did not reached the same point on Windows or Mac OS (all 3 fail, but they fail earlier). |
Can you run the following command in the docker to see if the file is accessible at all?
or you can use curl if you prefer |
This is the output inside the docker container:
We use docker to compile the NetCDF and use the resulting binary libnetcdf.so.XY without docker. I see this error actually outside of the docker environment (same results of the wget test). |
Thanks. The fact that it fails on linux is odd. I can see why it might fail on windows. |
Julia also depends on libcurl, so the libcurl version is kind of fixed. Calling the private
If I call |
re: Unidata#2380 re: Unidata#2337 This PARTIALLY fixes some HOME problems because under Windows, the HOME environment variable may not be set. In that case, use the USERPROFILE environment variable instead.
Here is the proposed API for managing the .rc table: Add two functions to netcdf.h to allow programs to walk and The new signatures are as follows:
|
This API seems perfect to me! (but I cannot tell if there are enough const and * in the function signature as my C knowledge is quite limited ;-) ) I am wondering if the strings passed to |
Yeh, const are confusing. I think I will change it so that the return values For the replace fcn, the strings are copied internally, so the user |
Yes, handling the memory as you propose makes the most sense to me too! |
re: Unidata#2337 re: Unidata#2407 Add two functions to netcdf.h to allow programs to get/set selected entries into the internal .rc tables. This should fix the above issues by allowing HTTP.CAINFO to be set to the certificates directory. Note that the changes should be performed as early as possible in the program because some of the .rc table entries may get cached internally and changing the entry after that caching occurs may have no effect. The new signatures are as follows: 1. Get the value of a simple .rc entry of the form "key=value". Note that caller must free the returned value, which might be NULL. ```` char* nc_rc_get(char* const * key); @param key table entry key @return value if .rc table has entry of the form key=value @return NULL if no such entry is found. ```` 2. Insert/Overwrite the specified key=value pair in the .rc table. ```` int nc_rc_set(const char* key, const char* value); @param key table entry key -- may not be NULL @param value table entry value -- may not be NULL @return NC_NOERR if no error @return NC_EINVAL if error ```` Addendum: re: Unidata#2407 Modify dhttp.c to use the .rc entry HTTP.CAINFO if defined.
I changed the API to significantly simplify it and to cover the most |
Unfortunately, I also see this failed assertion when I call
(OS: Linux and $HOME defined) |
re: Unidata#2380 re: Unidata#2337 This PARTIALLY fixes some HOME problems because under Windows, the HOME environment variable may not be set. In that case, use the USERPROFILE environment variable instead.
I am closing this issue because it is likely to be the same as: #2486 The option Thank you very much for implementing the new API and your work in NetCDF in general ! |
With the new NetCDF 4.8.1 updated in Julia, we have an issue to accessing OPeNDAP resources over HTTPs. It seems that no certificate authority is loaded by default. In the new version of NetCDF 4.8.1 we also link against a new version of libCURL (now 7.81.0 previously 7.73.0).
the version of the software with which you are encountering an issue
NetCDF 4.8.1
environmental information (i.e. Operating System, compiler info, java version, python version, etc.)
Ubuntu 20.04 and x86_64-linux-gnu-gcc (GCC) 4.8.5 (compilation is done within a docker container)
nc_open
(called by NCDataset) with a HTTPS url results in the following error:If I define a
~/.ncrc
file with the following contentHTTP.SSL.CAINFO
, then OPENDAP over HTTPS works:I am wondering if somebody can shed some light how it worked before (as in NetCDF 4.7.4/libcurl 7.73.0 such configuration file was not needed) and if it is possible to restore the previous behavior.
As noted by @visr, some libraries (like GDAL, Proj4) expose a function to set this path programmatically. This solution would also be ideal for NetCDF in Julia.
(Any insight on how this is solved in e.g. anaconda or R would be very useful.)
Reference:
Alexander-Barth/NCDatasets.jl#173
JuliaPackaging/Yggdrasil#4843
The text was updated successfully, but these errors were encountered: