I am trying to connect to a website with requests
one that requires the use of a client certificate.
import requests
r = requests.get(url, cert='path to cert')
print(r.status_code)
This works for a single site that uses the same client certificate. This server uses TLS_RSA_WITH_AES_128_CBC_SHA, TLS 1.0
. However, my target site uses TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS 1.1
. So basically the difference is TLS 1 works, but TLS 1.1 doesn't. Everything works fine in the browser, so it should be connected with Python SSL.
I am using requests
version 2.7.0 and I also installed requests[security]
. pip freeze
:
cffi==0.9.2
cryptography==0.8.1
ndg-httpsclient==0.3.3
pyasn1==0.1.7
pycparser==2.10
pyOpenSSL==0.15.1
requests==2.7.0
six==1.9.0
, , requests.exceptions.SSLError: [SSL: TLSV1_ALERT_INTERNAL_ERROR] tlsv1 alert internal error (_ssl.c:600)
. Windows 7 Python 3.4.3. , , Windows, PyPi . , - ssl
, requests
.
Google . this StackOverflow, , ( ) .
, - , . , .
EDIT: . SSL : ": (2) : (80)". TCP- .
Content Type: Handshake (22)
Version: TLS 1.0 (0x0301)
Length: 512
Handshake Type: Client Hello (1)
Length: 508
Version: TLS 1.2 (0x0301)
.. , , TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
. ACKs .