将Zscaler证书安装到Anaconda3 [英] Installing Zscaler Certificate to Anaconda3

查看:422
本文介绍了将Zscaler证书安装到Anaconda3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在整个公司强制安装Zscaler之后,我的Anaconda开始在安装模块和使用请求获取URL时给我SSL验证错误

After the obligatory installation of Zscaler through out the Company my Anaconda started giving me the SSL verification Error while installing modules and using requests to get the urls

Error(SSLCertVerificationError(1,'[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败:无法获取本地发行者证书(_ssl.c:1076)'))':/simple/'some_module'/

Error(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))': /simple/'some_module'/

SSLError:HTTPSConnectionPool(host ='www.amazon.com',端口= 443):url超过了最大重试次数:/(由SSLError(SSLError(错误的握手:Error([('SSL例程',' tls_process_server_certificate','证书验证失败')]))))))

SSLError: HTTPSConnectionPool(host='www.amazon.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

关闭Zscaler后,一切正常,但是公司政策不允许这样做.....

With Zscaler being turned off it all works great, but the company policy does not allow that.....

我发现了一些绕过的问题,例如将verify设置为False,但这不是我想要的.

I found some bypasses like setting verify to False but it is not what I want.

我想将Zscaler证书(由我们的IT部门提供给我)安装到Anaconda

I would like to install the Zscaler certificate (which was provided to me by our IT department) to Anaconda

现在的问题似乎是它使用了conda的通用证书.

Now the problem seems to be that it uses conda’s generic certificates.

import ssl
print(ssl.get_default_verify_paths())

输出: DefaultVerifyPaths(cafile = None,capath = None,openssl_cafile_env ='SSL_CERT_FILE',openssl_cafile ='C:\ ci \ openssl_1581353098519 \ _h_env \ Library/cert.pem',openssl_capath_env ='SSL_CERT_DIR's \ opensl_cafile ='C: \ _h_env \ Library/certs')

Output : DefaultVerifyPaths(cafile=None, capath=None, openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='C:\ci\openssl_1581353098519\_h_env\Library/cert.pem', openssl_capath_env='SSL_CERT_DIR', openssl_capath='C:\ci\openssl_1581353098519\_h_env\Library/certs')

有什么想法可以将conda指向我拥有的Zscaler证书吗?

Any idea what could I possibly do to point conda to the Zscaler certificate that I have??

系统信息:Windows 10,Anaconda3 -2020.02,Python 3.7

system inf: Windows 10, Anaconda3 -2020.02, Python 3.7

非常感谢

推荐答案

您可以做的是:

  1. 打开浏览器,然后转到 www.google.com
  2. 在重新加载页面"按钮旁边,您将看到一个锁(请参见下图).点击它
  3. 点击:证书
  4. 点击标签:认证路径
  5. 选择Zsclaer根CA5,然后单击查看证书"按钮
  6. 单击选项卡:详细信息",然后单击复制到文件"按钮
  7. 选择以base-64编码的X.509(.CER)导出证书
  8. 选择保存文件的路径
  9. 打开Anaconda提示
  10. conda config -set ssl_verify path_of_the_file_that_you_just_saved
  1. Open a browser and go to www.google.com
  2. Next to the reload page button, you will see a lock (see picture below). click on it
  3. Click on : Certificat
  4. Click on the tab: Certification Path
  5. Select Zsclaer Root CA5 and the click on View Certificat button
  6. Click on the tab: Details and then click on Copy to file button
  7. Export the certificat choosing the base-64 encoded X.509 (.CER)
  8. Choose a path where to save the file
  9. Open Anaconda Prompt
  10. conda config -set ssl_verify path_of_the_file_that_you_just_saved

这篇关于将Zscaler证书安装到Anaconda3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆