Python2.7 pip install Certificate did not match expected hostname


异常信息

WARNING: Certificate did not match expected hostname: mirrors.aliyun.com. Certificate: {'notAfter': 'Oct 18 12:00:00 2020 GMT', 'subjectAltName': (('DNS', 'img.ucdl.pp.uc.cn'), ('DNS', 'iscsi.ucdl.pp.uc.cn'), ('DNS', 'slient.ucdl.pp.uc.cn'), ('DNS', 'alissl.ucdl.pp.uc.cn'), ('DNS', 'cdn.osupdateservice.yunos.com'), ('DNS', 'oss.ucdl.pp.uc.cn')), 'subject': ((('commonName', u'img.ucdl.pp.uc.cn'),),)}
Could not fetch URL https://mirrors.aliyun.com/pypi/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='mirrors.aliyun.com', port=443): Max retries exceeded with url: /pypi/simple/pip/ (Caused by SSLError(CertificateError("hostname 'mirrors.aliyun.com' doesn't match either of 'img.ucdl.pp.uc.cn', 'iscsi.ucdl.pp.uc.cn', 'slient.ucdl.pp.uc.cn', 'alissl.ucdl.pp.uc.cn', 'cdn.osupdateservice.yunos.com', 'oss.ucdl.pp.uc.cn'",),)) - skipping

错误原因

证书校验引发异常, 此时可以信任此网站不在进行证书认证

pip install xxx -i https://mirrors.aliyun.com/pypi/simple --trusted-host=mirrors.aliyun.com

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM