• Register
1 vote

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)

7.5k points

Please log in or register to answer this question.

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.

38.6k points
edited by

Related questions

0 votes
1 answer 18 views
Problem: Anyone willing to help with the requests? there are some exceptions _ssl.c:590 sslerror: eof occurred in violation of protocol.
asked Apr 14 jamuna1 30.2k points
1 vote
1 answer 203 views
Problem : I have to parse in __VIEWSTATE and __EVENTVALIDATION while sending a post request.I am trying to send a get request first to have those two values, and then parse then afterward.It always turns out throwing this error message: requests.exceptions.SSLError: ... by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))Any Idea How can I send get request ?
asked Apr 16 Sabbir Hossain 14.6k points
0 votes
1 answer 46 views
Problem: Someone give me a solution, Why EOF occurred in violation of protocol (_ssl.c:579)?
asked Apr 14 zayed1 61.8k points
0 votes
1 answer 12 views
Problem: Anyone know how to fix the protocol violation (_ssl.c:579) that occurred?
asked Apr 14 jamuna1 30.2k points
0 votes
1 answer 30 views
Problem: I am stuck now .. need some suggestions .. please help me .. Importerror: no module named requests
asked May 2 Ifra 43.4k points
0 votes
1 answer 108 views
Problem: I have configured a ListenHTTP 1.7.0 processor in NiFi 1.7.0-RC1. It is listening on a custom port behind a reverse proxy. I have configured a StandardRestrictedSSLContextService with a JKS keystore and have added the keystore password. We have not configured ... support a common SSL protocol version or cipher suite. Can anyone suggest what to try next or explain why we see this error?
asked Apr 25 sumaiya simi 43.9k points
0 votes
2 answers 2.1k 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 49 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, 2020 Marivoke 530 points
0 votes
1 answer 15 views
Problem: Has anyone experienced this before: Ssl.sslerror: [ssl: certificate_verify_failed] certificate verify failed (_ssl.c:777)?
asked Jun 13 Shima 126k points
0 votes
1 answer 14 views
Problem: Where can I get assistance: Ssl.sslerror: [ssl: certificate_verify_failed] certificate verify failed (_ssl.c:749)?
asked Jun 13 Shima 126k points