Closed tloubrieu-jpl closed 3 years ago
The packages installed are:
% pip freeze
pds.api-client==0.7.1
python-dateutil==2.8.2
six==1.16.0
urllib3==1.26.7
Hi @tloubrieu-jpl! Thanks for the thorough bug report.
I believe the sysadmins will need to address this by ensuring that Python 3.9 is built against a version of OpenSSL that supports the wildcard/intermediate certificates used by pds-gamma.
However, I'm unable to reproduce the error you're seeing. What python3.9
executable are you using?
Here's what I get:
Mon Oct 11 17:06:39 UTC 2021
$ hostname
pds-gamma.jpl.nasa.gov
$ /usr/local/python-3.9.5/bin/python3.9 -m venv venv
$ cd venv
$ bin/pip install --upgrade --quiet pip setuptools wheel build
$ bin/pip --quiet install pds.api-client
$ curl --silent --location --remote-name 'https://github.com/NASA-PDS/pds-api-client/files/7324095/test.py.zip'
$ unzip -qq test.py.zip
$ bin/python test.py
$ echo $?
0
$ echo \U+1F389
π
Thanks @nutjob4life , @gxtchen originally reported this bug and I am not sure which python he is using. For myself I use python 3.9 on macos, I installed 2 weeks ago, but I don't remember how...
@tloubrieu-jpl For a short-term workaround for @gxtchen, you could put this at the top of test.py
:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
This will turn off all certificate validation until such time that the Python 3.9 installation can be fixed.
An intermediate certificate is new (1-2 year old) which is required for certificates such as the one of JPL containing wildcard.
homebrew deployment provide the intermediate certificate.
I think this should be marked as closed
and wontfix
since the issue is not in our software but in the Python interpreter running it.
@gxtchen , you need to run pip install --upgrade certifi
in your virtual environment. Let me know if that helps. That worked for me.
We could add certifi
as a dependency of this package. It shouldn't hurt anyone who's Python installations know how to use SSL, but it might help those who's Python installations don't.
Yes that sounds good to me, I will add the dependency
Oops, actually requirements.txt is generated by openapi-generator...
I've added the instruction in the documentation, see commit e62a7e4
π Describe the bug
When requesting pds-gamma with python 3.9 there is an SSL certificate error
it works with python 3.7
See:
π To Reproduce
Steps to reproduce the behavior:
test.py.zip
π΅οΈ Expected behavior
The code should return the requested bundle
π Version of Software Used
0.7.1
π©Ί Test Data / Additional context
πScreenshots
π₯ System Info
π¦ Related requirements
βοΈ Engineering Details