1

Does anyone know why I am getting this error?

SSLError: [Errno 1] _ssl.c:510: error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1

I get the erro when using requests or urllib2, I'm running the code on Kodi. The code runs fine when I run it on Visual Studio on my PC.

I am trying to scrape a website that is blocked by my ISP, so I'm using a proxy version of the site.

import requests

url = 'https://kickass.unblocked.pe/'
r = requests.get(url)
Michael
  • 101
  • 1
  • 10

1 Answers1

5

The site is hosted by Cloudflare Free SSL and requires support for Server Name Indication (SNI). SNI is support with Python 2.7 only since version 2.7.9. I guess that you are using an older version.

verify=False (which is usually a bad idea anyway) will not help here because without SNI the handshake will fail because the server does not know which certificate is requested and thus will not sent any certificate but instead an alert.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172
  • Oh dear, Kodi runs Python 2.7.8 ...back to the drawing board. – Michael Dec 29 '15 at 15:47
  • For anyone interested, a ticket was raised for this: [->here<-](http://trac.kodi.tv/ticket/15883) – Michael Dec 29 '15 at 16:12
  • 1
    Newest Kodi builds are already using python version 2.7.10 See https://github.com/xbmc/xbmc/pull/8207 – Razze Dec 29 '15 at 20:43
  • If your running OpenElec you will have to wait for the Jarvis release (Python 2.7.11). – Michael May 19 '16 at 12:24
  • OMG... I have lost an entire day on this problem. Same exact scenario, code works perfectly in every other Python interpreter except Kodi. Running in Kodi always returns `URLError: ` Unfortunately I have a wide range of Kodi devices and upgrading to a development build is not an option. I guess I have to wait until there's a stable Kodi release that fixes this issue. – Neal Bailey Aug 02 '16 at 17:56