requests icon indicating copy to clipboard operation
requests copied to clipboard

Fix connection pool managers not taking varying TLS parameters into account

Open Overv opened this issue 4 years ago • 0 comments

This PR fixes #5140 and #4325 by returning different connection and proxy pools based on the connection parameters for the current request.

I tested it with the following code:

import requests

session = requests.Session()

print(session.get('https://client.badssl.com/'))
print(session.get('https://client.badssl.com/', cert=('client.crt', 'client.key')))
print(session.get('https://client.badssl.com/', cert=('client.crt', 'client.key')))
print(session.get('https://client.badssl.com/'))
print(session.get('https://client.badssl.com/'))

Which correctly outputs:

<Response [400]>
<Response [200]>
<Response [200]>
<Response [400]>
<Response [400]>

Instead of the previous output:

<Response [400]>
<Response [400]>
<Response [400]>
<Response [400]>
<Response [400]>

Overv avatar Oct 02 '19 18:10 Overv