1

Keep getting the following error:

requests.exceptions.SSLError: [SSL: TLSV1_ALERT_INTERNAL_ERROR] tlsv1 alert internal error (_ssl.c:590)

when trying to run

f = requests.get("https://api.tfl.gov.uk/......")

Adding verify=False inside requests.get() doesn't help at all.

Dmitry Rastorguev
  • 3,473
  • 4
  • 13
  • 14
  • Let me just guess because the necessary information are missing from your question: you are using an old version of OpenSSL, like version 0.9.8 which is typically found on even recent MacOS systems. And this version does not support TLS 1.2 which is required by the server according to [SSLLabs](https://www.ssllabs.com/ssltest/analyze.html?d=api.tfl.gov.uk&s=104.16.26.236&latest). If this is not the case please add the output of `python -c "import ssl; print ssl.OPENSSL_VERSION"` to your question. – Steffen Ullrich Feb 06 '17 at 19:04
  • @SteffenUllrich The output is indeed `OpenSSL 0.9.8zh 14 Jan 2016` MacOS is 10.12.2 – Dmitry Rastorguev Feb 06 '17 at 19:12
  • In this case see [Updating openssl in python 2.7](http://stackoverflow.com/questions/18752409/updating-openssl-in-python-2-7) – Steffen Ullrich Feb 06 '17 at 19:13
  • @SteffenUllrich Unfortunately, I struggled to update the OpenSSL, as I was unable to update the paths to the newer version, once it was installed. I did manage to find a short term solution to the problem by setting a [virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/) – Dmitry Rastorguev Feb 07 '17 at 18:36

0 Answers0