在Python環(huán)境中訪問(wèn)HTTPS網(wǎng)站時(shí),包括HTTPS需要使用代理的過(guò)程中,如果遇到類似SSL: CERTIFICATE_VERIFY_FAILED相關(guān)的錯(cuò)誤,說(shuō)明目標(biāo)網(wǎng)站的HTTPS證書(shū)認(rèn)證不通過(guò),需要忽略對(duì)HTTPS證書(shū)的驗(yàn)證,可以在訪問(wèn)之前加上 

import ssl

    try: _create_unverified_https_context = ssl._create_unverified_context

except AttributeError:

# Legacy Python that doesn't verify HTTPS certificates by default 

     pass

else:

# Handle target environment that doesn't support HTTPS verification ssl._create_default_https_context =     _create_unverified_https_context

使Python忽略對(duì)證書(shū)的驗(yàn)證

以上內(nèi)容如果沒(méi)有解決您的問(wèn)題,可通過(guò)以下方式反饋: