-
Notifications
You must be signed in to change notification settings - Fork 75
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
SSL Error with Certificate in catalog.py #281
Comments
I appreciate the report. Does this answer on Stack Overflow help? I think it should work if you pass with siphon.http_util.session_manager.urlopen(endpoint_url) as f:
... Using functions that start with |
@dopplershift : Thank you for the response. Here's what's happening after trying some StackOverFlow I've added to the top:
commented-out in get_plane_data,
and replaced it with
I think I'm missing something because this now thows an error:
Even though using _create_unverfied_context is naughty, I did get the get_plane_data function to work. The function, get_goes_image, is still failing. I am not sure how to correct this yet still. I've tried adding the recommended commands to the more simple example, Basic_Usage.py, and still get the proxy errors. |
What you have is not quite valid use of Python imports. You can either do: from siphon.http_util import session_manager
...
with session_manager.urlopen(endpoint_url) as f: OR import siphon.http_util
...
with siphon.http_util.session_manager.urlopen(endpoint_url) as f: (The |
I have a similar problem while working on my corporate network. The only solution that I have found is with any HTTP GET request, I must pass specific set of headers and turn off SSL verify. When I am just performing a simple request with the requests module directly, I can set these options to whatever I need. However, I have found siphon quite useful for acquiring MET data, so I did a little digging through the source and found an easy way to also pass the same arguments through here. Check out this PR to see which lines I modified. #303 Exactly which settings you need to get this working on your proxy are probably different than mine, but hopefully this minor code change to siphon will allow you to get running at work. |
Please redirect or absolve the issue if it violates the contributing guidelines
I've been working to get a tutorial python code from the Unidata site called GOES_aircraft.py, working from my corporation's computer. In the script, there are two function calls to retrieve data. When I execute this script, it fails with SSL errors related to the certificate verify failing. (note: This looks like a common problem for people running python scripts behind corporate firewalls.)
I've managed to figure-out a work-around for the first function, 'get_plane_data' by adding / altering these two lines:
.....
context = ssl._create_unverified_context()
with urllib.request.urlopen(endpoint_url, context=context) as f:
.....
When it comes to the second function, however, 'get_goes_image', I am not sure how to bypass the certificate check in the TDSCatalog call. I've looked through the catalog.py script for a flag for a solution, but am unable to identify where to begin.
Help or advice is greatly appreciated.
The text was updated successfully, but these errors were encountered: