I have recently upgraded my Python installation from 3.7 to 3.9. Previously we used an Anaconda installation, now we run “pure” Python.
Problem is, I can’t connect to the API, with the code I used before:
import DatastreamDSWS as DSWS
http_proxy = "http://xx.xxx.net:8080"
https_proxy = "https://xx.xxx.net:8080"
os.environ['HTTP_PROXY'] = http_proxy
os.environ['HTTPS_PROXY'] = https_proxy
ds = DSWS.Datastream(username='USER', password="SECRET")
I get this error-message:
There are two mechanisms of providing proxy information to DSWS modules. Programmatically and through configuration files.
Try the following in your code:
import DatastreamDSWS as dsws ds = dsws.Datastream(username='XXXXXXX', password='XXXXXXX', proxy='https://proxy_user:proxy_password@proxyip:port')
Although, looking at your exception message, it does not look like a proxy issue. Seems like python instance does not like the SSL (WRONG_VERSION_NUMBER). It could be that your proxy re-signs the request and uses an older TLS version. Try to run your application from a network without a proxy server - so that you can rule out the issue with your python installation.