Happy Business Starts Here

54, 'Connection reset by peer' (URGENT)


54, 'Connection reset by peer' (URGENT)

Hi, I am getting connection reset by peer error while accessing sandbox. Can you please let me know how to resolve this. Thank You


Python code:


import requests

url = 'https://apisandbox-api.zuora.com/rest/v1/connections'
headers = {
'apiAccessKeyId': 'userid',
'apiSecretAccessKey': 'password',
'Content-Type': 'application/json'
response = requests.post(url, headers=headers)
print response




Traceback (most recent call last):

  File "zoura.py", line 9, in <module>

    response = requests.post(url, headers=headers)

  File "/Library/Python/2.7/site-packages/requests/api.py", line 107, in post

    return request('post', url, data=data, json=json, **kwargs)

  File "/Library/Python/2.7/site-packages/requests/api.py", line 53, in request

    return session.request(method=method, url=url, **kwargs)

  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 468, in request

    resp = self.send(prep, **send_kwargs)

  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 576, in send

    r = adapter.send(request, **kwargs)

  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 447, in send

    raise SSLError(e, request=request)

requests.exceptions.SSLError: ("bad handshake: SysCallError(54, 'Connection reset by peer')",)

Zuora Staff

Re: 54, 'Connection reset by peer' (URGENT)


What version of python are you using and is it capable of correctly leverging a connection using TLS 1.1 or TLS 1.2 ?


API Sandbox requires TLS 1.1 or higher connections, so it's possible this error is due to attempting connection using an unsupported SSL Protocol.

You may wish to review our post in Community concerning disabling TLS 1.0 - http://community.zuora.com/t5/Zuora-Announcements/Action-Required-Zuora-is-Disabling-TLS-1-0/ba-p/21... - where we do touch on which Python versions are compatable.  To that, I will add the following to the best of my knowledge.

Python 2.7.8 and before is not compatable with TLS 1.1+

Python 2.7.9 is compatable (but requires patching and dependancy on OpenSSL version supporting appropriate TLS version)

Python 3.2.4 is compatable by default

If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √


Re: 54, 'Connection reset by peer' (URGENT)

I have tried with python 2.7 as well as python 3.5. I am getting error in both cases. How do I disable TLS1.0 and enable TLS1.1 on my mac for Python?