-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Labels
enhancementFeature improvement or requestFeature improvement or request
Description
Currently, xDEM does not support adding an SSL context for urllib.request.urlopen calls, which is required in some cases to authenticate with the server. When trying to fetch data using xdem.examples.get_path, the function fails because it does not support adding an SSL context. The error occurs because the server requires a valid SSL certificate for authentication.
The xdem.examples.get_path function should support adding an SSL context to urllib.request.urlopen calls. This would allow users to provide a certificate file path (cafile) to validate the connection.
def get_path(self, example_name, cafile=None):
....
if cafile:
context = ssl.create_default_context(cafile=cafile)
response = urllib.request.urlopen(url, context=context)
else:
response = urllib.request.urlopen(url)
Metadata
Metadata
Assignees
Labels
enhancementFeature improvement or requestFeature improvement or request