Skip to content Skip to sidebar Skip to footer

Sslerror: ("bad Handshake: Syscallerror(54, 'econnreset')",)

I am trying to fire a post request to the server using requests library. I am using the following stack: appdirs==1.4.3 asn1crypto==0.22.0 boto==2.46.1 certifi==2017.4.17 cffi==1.1

Solution 1:

I was able to find solution for this issue, I just changed the ssl protocol type while creating PoolManager from "ssl.PROTOCOL_TLSv1" to "ssl.PROTOCOL_TLSv1_2" as follows, this solved the above issue:

self.poolmanager = PoolManager(num_pools=connections,
                                   maxsize=maxsize,
                                   block=block,
                                   ssl_version=ssl.PROTOCOL_TLSv1_2)

But the above will give InsecureRequests warnings, you can suppress the same by using the following command:

from requests.packages.urllib3.exceptionsimportInsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

Hope it helps.

Post a Comment for "Sslerror: ("bad Handshake: Syscallerror(54, 'econnreset')",)"