Bug 1258002 - pip version in python cartridge does not work with proxies
Summary: pip version in python cartridge does not work with proxies
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Vu Dinh
QA Contact: Gaoyun Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-28 15:12 UTC by Evgheni Dereveanchin
Modified: 2019-10-10 10:07 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-09 13:47:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Evgheni Dereveanchin 2015-08-28 15:12:08 UTC
Description of problem:

The version of pip (1.4.1) shipped with python-2.7 cartridge is known not to work with proxies

Version-Release number of selected component (if applicable):
openshift-origin-cartridge-python-1.31.3.1-1.el6op.noarch

How reproducible:
always

Steps to Reproduce:
1. create a python app
rhc app create test python-2.7
2. inject HTTP_PROXY env var
rhc env set HTTP_PROXY=http://proxy.hostname.or.ip:3128 --app test
3. add a dependency to requirements.txt
4. push the code

Actual results:
build errors suggesting a certificate mismatch:

remote:   File "/var/lib/openshift/55e04612bafef5286b00000f/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/download.py", line 139, in connect
remote:     match_hostname(self.sock.getpeercert(), self.host)
remote:   File "/var/lib/openshift/55e04612bafef5286b00000f/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/backwardcompat/ssl_match_hostname.py", line 61, in match_hostname
remote:     % (hostname, ', '.join(map(repr, dnsnames))))
remote: CertificateError: hostname 'proxy.hostname.or.ip' doesn't match either of 'www.python.org', 'python.org', 'pypi.python.org', 'docs.python.org', 'testpypi.python.org', 'bugs.python.org', 'wiki.python.org', 'hg.python.org', 'mail.python.org', 'packaging.python.org', 'pythonhosted.org', 'www.pythonhosted.org', 'test.pythonhosted.org', 'us.pycon.org', 'id.python.org'
remote: 
remote: Traceback (most recent call last):


Expected results:
build does not error out

Additional info:
newer versions of pip seem to work properly
the error also goes away as soon as HTTP_PROXY is unset, however this is not applicable for secured environments where there's no direct access to the Internet from gears.


Note You need to log in before you can comment on or make changes to this bug.