点击SSL错误,但卷曲工作 - Windows背后的企业代理与CNTLM

时间:2015-03-01 23:05:06

标签: python windows ssl proxy pip

我正试图在公司代理后面的Windows机器上运行pip。我正在使用CNTLM代理添加身份验证。

以下命令有效:

curl --cacert C:\Users\xxxxxxx\curl-ca-bundle.crt https://www.google.com.au

但是以下命令不是:

pip install --cert C:\Users\xxxxxx\curl-ca-bundle.crt install six

我在HTTP_PROXY和HTTPS_PROXY环境变量中设置了CNTLM代理设置,并且可以确认pip和curl都在使用它们(将env变量更改为无效地址会产生错误)。 cert文件是Mozilla信任存储,其中附加了我的公司Root证书。如果卷曲使用它很好,我会认为使用pip是好的。

Pip日志显示TLSv1警报解码错误:

------------------------------------------------------------
C:\Python27\Scripts\pip run on 03/02/15 09:12:03
Downloading/unpacking six
  Getting page https://pypi.python.org/simple/six/
  Could not fetch URL https://pypi.python.org/simple/six/: connection error: [SSL: TLSV1_ALERT_DECODE_ERROR] tlsv1 alert decode error (_ssl.c:581)
  Will skip URL https://pypi.python.org/simple/six/ when looking for download links for six
  Getting page https://pypi.python.org/simple/
  Could not fetch URL https://pypi.python.org/simple/: connection error: [SSL: TLSV1_ALERT_DECODE_ERROR] tlsv1 alert decode error (_ssl.c:581)
  Will skip URL https://pypi.python.org/simple/ when looking for download links for six
  Cannot fetch index base URL https://pypi.python.org/simple/
  URLs to search for versions for six:
  * https://pypi.python.org/simple/six/
  Getting page https://pypi.python.org/simple/six/
  Could not fetch URL https://pypi.python.org/simple/six/: connection error: [SSL: TLSV1_ALERT_DECODE_ERROR] tlsv1 alert decode error (_ssl.c:581)
  Will skip URL https://pypi.python.org/simple/six/ when looking for download links for six
  Could not find any downloads that satisfy the requirement six
Cleaning up...
  Removing temporary dir c:\users\xxxxxxx\appdata\local\temp\pip_build_xxxxxx...
No distributions at all found for six
Exception information:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip\commands\install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "C:\Python27\lib\site-packages\pip\req.py", line 1177, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "C:\Python27\lib\site-packages\pip\index.py", line 277, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for six

有关如何解决此错误的任何建议?如果pip允许,我甚至会打开禁用SSL。

N.B我正在运行pip 1.5.6 w / python 2.7.9

0 个答案:

没有答案