Bug 1329395

Summary: urllib3 PoolManager does not pool connections based on SSL configuration
Product: Red Hat Enterprise Linux 7 Reporter: Jeremy Cline <jcline>
Component: python-urllib3Assignee: Iryna Shcherbina <ishcherb>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: bkearney, bnater, cstratak, hhorak, ishcherb, jalberts, jhouska, jkejda, lmiksik, pviktori, rbarlow, thozza, tlavigne, torsava
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-urllib3-1.10.2-3.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 16:18:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1356060, 1380359, 1393868    
Attachments:
Description Flags
Proposed patch
none
test_urllib3.py none

Description Jeremy Cline 2016-04-21 19:51:31 UTC
Created attachment 1149549 [details]
Proposed patch

Description of problem:
Note this also affects RHEL 6 and I've filed the same bug against it: https://bugzilla.redhat.com/show_bug.cgi?id=1329382

If a user of urllib3 modifies the ``connection_pool_kw`` dictionary on the ``urllib3.poolmanager.PoolManager`` class to change the SSL configuration (client certificate and key, CA certificate bundle, SSL version, and whether or not the server's certificate must be valid), the ``PoolManager`` instance will not consider these new configurations when providing a pooled connection for a request.

This results in existing connections that are not configured as the user expects to be used rather than new connections being created. This causes issues like https://github.com/kennethreitz/requests/issues/2863. 

Version-Release number of selected component (if applicable):
All versions equal to or below urllib3 version 1.15.z


How reproducible:
Easily and reliably reproducible.

Steps to Reproduce:
1. See attached Python script - this script attempts to reconfigure the CA bundle used by urllib3. It deletes the old CA file so that if the PoolManager uses the old one, it gets a "No such file or directory error". Doing `python test_urllib3.py` on a version of urllib3 affected by this bug will produce a traceback. 

Actual results:
Old SSL configurations are used.


Expected results:
New SSL configurations are used.

Additional info:
The patch for this bug has been accepted upstream, but is not yet in a released version: https://github.com/shazow/urllib3/pull/830

This is an issue Satellite 6 suffers from.

Comment 5 Charalampos Stratakis 2016-11-15 10:06:59 UTC
*** Bug 1394919 has been marked as a duplicate of this bug. ***

Comment 7 Iryna Shcherbina 2017-01-18 17:01:40 UTC
Created attachment 1242221 [details]
test_urllib3.py

The script mentioned in Steps to Reproduce.

Obtained from the RHEL 6 bug.

Comment 11 errata-xmlrpc 2017-08-01 16:18:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1884