Both the Python version and the SSL version will cause requests to make some mistakes when requesting HTTPS sites, preferably with a new version.
1 python2.6x Use Requests
An old CentOS machine running on an old application, adding a new module after the error error insecureplatformwarning:a true Sslcontext object is not Available.
/usr/lib/python2.6 /site-packages/requests/packages/urllib3/util/ssl_.py:132 : Insecureplatformwarning:a true sslcontext object is Not Available. This prevents urllib3 from Configuring SSL appropriately and may cause certain SSL connections to Fail. You can upgrade to a newer version of Python to Solve This. For more information, see https ://urllib3.readthedocs.io/en/latest/ Advanced-usage.html #ssl-warnings insecureplatformwarning
Solutions
Using the old version of requests
$pip install requests==2.5.3
Or install it like this
$ pip install requests[security]
2
SSL3_GET_SERVER_CERTIFICATE
: Certificate Verify failed
Error following version python2.7.5
Traceback (most Recent Call last): File"./test.py", line -,inch<module> response = Requests.Get(url1, Headers=headers) File"build/bdist.linux-x86_64/egg/requests/api.py", line the,inch GetFile"build/bdist.linux-x86_64/egg/requests/api.py", line +,inchRequest File"build/bdist.linux-x86_64/egg/requests/sessions.py", line 209,inchRequest File"build/bdist.linux-x86_64/egg/requests/models.py", line 624,inch SendFile"build/bdist.linux-x86_64/egg/requests/models.py", line -,inch _build_response File"build/bdist.linux-x86_64/egg/requests/models.py", line 611,inch SendRequests.exceptions.SSLError: [Errno1]_sslC503: error:14090086: SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate Verify failed
Workaround
You can disable verify
>>> requests.get(‘https://google.com‘, verify=True)
Problem Address Python-requests-throwing-up-sslerror
3 Sslerror:bad Handshake
Sslerror:bad handshake:error ([' SSL routines ', ' ssl3_get_server_certificate ', ' CERTIFICATE verify failed ')] python2.7.5
pip uninstall -y certifi && pip install certifi==2015.04.28
discussion See Also: https://github.com/rackspace/pyrax/issues/601
Python Requests Error Resolution Collection