• Register
1 vote
47 views

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)

6 5 3
7,540 points

1 Answer

0 votes

Solution :

Below codes worked for me, just make sure that whether these modules are installed or not, if not installed then please install them, below are:

pip install ndg-httpsclient
pip install pyopenssl
pip install pyasn1

It removed the SSLError: EOF occurred in violation of protocol (_ssl.c:690) error.

9 7 4
38,600 points

Related questions

0 votes
2 answers 771 views
771 views
Problem: I am attempting to download records from a https webpage and continue getting the accompanying error: OpenSSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure Unable to establish SSL connection. From perusing sites online I assemble I need to give ... alternative however that didn't work. wget version: wget-1.13.4 openssl version: OpenSSL 1.0.1f 6 Jan 2014
asked Nov 30, 2019 alecxe 7.5k points
1 vote
1 answer 10 views
10 views
I am trying to open an https URL using the urlopen method in Python 3's urllib.request module. It seems to work fine, but the documentation warns that "[i]f neither cafile nor capath is specified, an HTTPS request will not do any verification of the server&rsquo;s ... get this list from? Is there any simple and cross-platform way to use the same list of certificates that my OS or browser uses?
asked Sep 13 Marivoke 530 points
0 votes
2 answers 181 views
181 views
Problem : I am getting bellow error while using keytool keytool error: java.lang.exception: public keys in reply and keystore don't match
asked Oct 19, 2019 peterlaw 6.9k points
0 votes
1 answer 16 views
16 views
Problem: I am trying to consume a PHP webservice which has the SSL certificate. I have the .net 3.5 Class library it references the webservice with a 'Add Service references' in Visualstudio 2010 If I try calling the main method of my webservice then I ... SslPolicyErrors sslPolicyErrors) { return true; } But somehow it is not working. Also I have already a certificate installed on my own pc.
asked Aug 12 Raphael Pacheco 4.9k points