<urlopen error [Errno 1] _ssl.c:510: error:14077417:SSL

徘徊边缘 提交于 2020-01-11 11:47:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!