Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-26841

pip3.9 does not work properly behind an https proxy

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Undefined Undefined
    • None
    • rhel-9.3.0
    • python3.9
    • None
    • None
    • None
    • rhel-sst-pt-python-ruby-nodejs
    • ssg_core_services
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      pip3.9 does not reliably work through a proxy when defind via $https_proxy environment variable.

      Please provide the package NVR for which bug is seen:

      python3-pip-21.2.3-7.el9.noarch

      How reproducible:

      Every time

      Steps to reproduce

      1.  Set up a proxy. It can be a simple Squid proxy on any RHEL version (tested with RHEL 7).
      2.

      # export https_proxy=https://<proxy_hostname>:8080

      3.

      # pip3.9 install pymssql

      Expected results

      The pymssql package is downloaded and installed.

      Actual results

      The following gets printed to the console:

      [root@r93 ~]# pip3.9 install pymssql
      WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)'))': /simple/pymssql/
      WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)'))': /simple/pymssql/
      WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)'))': /simple/pymssql/
      WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)'))': /simple/pymssql/
      WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)'))': /simple/pymssql/
      Could not fetch URL [https://pypi.org/simple/pymssql/:] There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pymssql/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)'))) - skipping
      ERROR: Could not find a version that satisfies the requirement pymssql (from versions: none)
      ERROR: No matching distribution found for pymssql
      Could not fetch URL [https://pypi.org/simple/pip/:] There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)'))) - skipping
      [root@r93 ~]# 
      

      Note that RHEL 8 is unaffected by this. Additionally, a workaround exists for RHEL 9 whereby if the proxy is defined as follows, the issue is not triggered:

      # export https_proxy=http://<proxy_hostname>:8080
      

      Possibly related to https://github.com/pypa/pip/issues/9568. Applied the fix in https://github.com/pypa/pip/pull/10680 but it does not seem to work.

              python-maint python-maint
              rhn-support-jsantos Juan Santos
              python-maint python-maint
              bot rhel-cs-apps-subsystem-qe bot rhel-cs-apps-subsystem-qe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: