-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session adapter doesn't update https connections cert data #4325
Comments
Yeah. Requests is using some old APIs in urllib3 that don’t interact with the connection pooling. It should update to pass the TLS data into the pool manager to ensure that the TLS info factors in. |
@Lukasa thanks for your prompt reply |
This is also true of the certificate/key paths provided in the |
Still observing this in 2.21.0, but you can issue session.close() to clear out the poolmanager, which will allow new requests with different verify values to be paid attention to. |
…session.close() is suggested as a workaround. psf/requests#4325
Under a session, the first https request sets the HTTPSConnectionPool certs data.
If in a subsequent request, we change the certs data (eg: Set verify to True), the adaptor will update the ConnectionPool attributes, however each connection in the pool will still contain the old certs data, thus when requesting a connection from the pool, its info will differ from what we would expect.
Expected Result
The used connection should have updated certs data
Actual Result
The used connection have "old" certs data.
Reproduction Steps
These tests where performed against a server with a self-signed CA.
I'm aware ConnectionPool is in urllib realm, but since it's the adaptor who is updating the pool data, perhaps it should also handle this scenario?
System Information
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.7.2"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.12"
},
"platform": {
"release": "4.4.0-59-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1000207f",
"version": "16.0.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
The text was updated successfully, but these errors were encountered: