• 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)

6 5 3
7,540 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.

9 7 4
38,600 points

Related questions

0 votes
2 answers 1.5K 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 23 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 28 views
Problem: On a router with merlin firmware, I installed entware and python, after I ran speedtest python script. It shows error: python2.7# speedtest Retrieving speedtest.net configuration... Cannot retrieve speedtest configuration ERROR: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)>
asked Jan 23 Mashhoodch 13k points
0 votes
2 answers 297 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 17 views
Problem do you want to view only the webpage content that was delivered securely
asked Feb 9 charles mathews 5.5k points
0 votes
1 answer 201 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, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 57 views
Problem : I have the Java web service client, which consumes the web service via HTTPS. When I try to connect to the service URL (https://AAA.BBB.CCC.DDD:9443/ISomeService ), I get the exception as below: &ldquo; Java.security.cert.CertificateException: No subject alternative names present.&rdquo;
asked Jan 21, 2020 jwilliam 3.9k points
0 votes
1 answer 608 views
Problem : I have a java complied package and it is sopposed to communicate with https server on net. But when i try running the compilation gives the following exception: javax.net.ssl.sslexception: unrecognized ssl message, plaintext connection?
asked Oct 23, 2019 peterlaw 6.9k points
0 votes
1 answer 163 views
Problem : I have a Java web service client, which consumes a web service via HTTPS. When I connect to the service URL, I get the exception java.security.cert.CertificateException: No subject alternative names present.
asked Oct 22, 2019 peterlaw 6.9k points