Bug 1258002 - pip version in python cartridge does not work with proxies
pip version in python cartridge does not work with proxies
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image (Show other bugs)
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Vu Dinh
Gaoyun Pei
Depends On:
  Show dependency treegraph
Reported: 2015-08-28 11:12 EDT by Evgheni Dereveanchin
Modified: 2016-05-09 10:24 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-05-09 09:47:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Evgheni Dereveanchin 2015-08-28 11:12:08 EDT
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):

How reproducible:

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: 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.