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

 

posted @ 2020-09-17 17:02  HPCM  阅读(5547)  评论(0编辑  收藏  举报