title: Python requests gets TLSV1_ALERT_INTERNAL_ERROR
body: <p>I am trying to  connect to a website with <code>requests</code> that requires using a client certificate.</p>
  
  <pre><code>import requests
  r = requests.get(url, cert='path to cert')
  print(r.status_code)
  </code></pre>
  
  <p>This works for one site that uses the same client cert. That server is using <code>TLS_RSA_WITH_AES_128_CBC_SHA, TLS 1.0</code>. However my target site uses <code>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS 1.1</code>. So basically the difference is TLS 1 works and TLS 1.1 doesn't. Everything works fine in browser so it must have something to do with Python's SSL.</p>
  
  <p>I am using <code>requests</code> version 2.7.0 and I have <code>requests[security]</code> installed as well. <code>pip freeze</code>:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The specific error I am getting is <code>requests.exceptions.SSLError: [SSL: TLSV1_ALERT_INTERNAL_ERROR] tlsv1 alert internal error (_ssl.c:600)</code>. This is on Windows 7 with Python 3.4.3. Unfortunately this is on an internal machine so I am stuck with Windows and our internal mirror of PyPi does not have the latest versions of everything. It seems to me like this has something to do with <code>ssl</code> failing and not necessarily <code>requests</code>.</p>
  
  <p>Google does not give back promising results. There is <a href="https://stackoverflow.com/questions/22857889/ssl-error-using-python-requests-to-access-shibboleth-authenticated-server">this</a> StackOverflow post that describes the same problem, but the solution provided (using a custom adapter) does not work for me.</p>
  
  <p>Hopefully someone else has run into this before and can give me some tips on how to fix it. Please and thanks.</p>
  
  <p>EDIT: I did a wireshark capture of the interaction. The SSL alert sent back is "Level: Fatal (2) Description: Internal Error (80)". After the TCP connection start, my machine sends a client hello.</p>
  
  <pre><code>Content Type: Handshake (22)
  Version: TLS 1.0 (0x0301)
  Length: 512
  </code></pre>
  
  <p>Then the handshake protocol segment of that packet is</p>
  
  <pre><code>Handshake Type: Client Hello (1)
  Length: 508
  Version: TLS 1.2 (0x0301)
  </code></pre>
  
  <p>followed by a list of the supported cipher suites, etc. I looked in the list of cipher suites sent by my client and <code>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</code> is listed. The server ACKs this message then sends the Alert packet.</p>