Problem :
I want to retrieve some of the information from the ABB G13 gateway that offer the RESTful JSON API. API is hosted by a gateway via the https endpoint. Basic authentication mechanism is used for the authentication. However all the traffic goes through the SSL layers.
On linux I tried with below command:
curl -s -k -X GET -u user:password https://host/meters/a_serial/power
All is going well!
But when I am trying to write the script for the windows in Python 2.7.10 with the Requests 2.8.1 and with below code:
import requests
requests.get('https://host/meters/a_serial/power', auth=('user', 'password'))
I often face below error:
Traceback (most recent call last):
File "C:/Users/alecxe/PycharmProjects/pwrgtw/test.py", line 41, in <module>
requests.get('https://host/meters/a_serial/power', auth=('user', 'password'))
File "C:\Python27\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 62, in request
response = session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 570, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 616, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 522, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:680)