问题
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)
回答1:
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.
来源:https://stackoverflow.com/questions/34513784/urlopen-error-errno-1-ssl-c510-error14077417ssl