📜  忽略证书 ssl - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:30.638000             🧑  作者: Mango

代码示例3
import urllib2, ssl

ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

opener = urllib2.build_opener(urllib2.HTTPSHandler(context=ctx), your_first_handler, your_second_handler[...])
opener.addheaders = [('Referer', 'http://example.org/blah.html')]

content = opener.open("https://localhost/").read()