Skip to content

[PR #12238/24cb8c9c backport][3.14] Skip TLS-in-TLS warning when proxy is not HTTPS#12248

Merged
Dreamsorcerer merged 1 commit into3.14from
patchback/backports/3.14/24cb8c9ca414dcda009717c0872019e62fc4ef3a/pr-12238
Mar 16, 2026
Merged

[PR #12238/24cb8c9c backport][3.14] Skip TLS-in-TLS warning when proxy is not HTTPS#12248
Dreamsorcerer merged 1 commit into3.14from
patchback/backports/3.14/24cb8c9ca414dcda009717c0872019e62fc4ef3a/pr-12238

Conversation

@patchback
Copy link
Copy Markdown
Contributor

@patchback patchback bot commented Mar 16, 2026

This is a backport of PR #12238 as merged into master (24cb8c9).

Summary

  • The _warn_about_tls_in_tls warning was firing for all HTTPS requests through any proxy, but TLS-in-TLS only applies when the proxy itself uses HTTPS.
  • When the proxy is HTTP, start_tls upgrades a plain TCP connection, which is not TLS-in-TLS and works fine everywhere.
  • Added a check for req.proxy.scheme so the warning is only emitted when the proxy is actually HTTPS.

Fixes #10683

Test plan

  • Existing test_https_proxy_unsupported_tls_in_tls covers the HTTPS-proxy case and should still pass (warning still fires for HTTPS proxies on old Python).
  • HTTPS requests through an HTTP proxy no longer produce the misleading warning.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 16, 2026

Merging this PR will not alter performance

✅ 59 untouched benchmarks


Comparing patchback/backports/3.14/24cb8c9ca414dcda009717c0872019e62fc4ef3a/pr-12238 (3abe98d) with 3.14 (5f50bac)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.35%. Comparing base (5f50bac) to head (3abe98d).
⚠️ Report is 1 commits behind head on 3.14.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             3.14   #12248      +/-   ##
==========================================
- Coverage   98.36%   98.35%   -0.01%     
==========================================
  Files         131      131              
  Lines       45852    45854       +2     
  Branches     2493     2494       +1     
==========================================
- Hits        45102    45101       -1     
- Misses        571      574       +3     
  Partials      179      179              
Flag Coverage Δ
CI-GHA 98.23% <100.00%> (-0.02%) ⬇️
OS-Linux 97.99% <100.00%> (-0.02%) ⬇️
OS-Windows 95.63% <100.00%> (-0.01%) ⬇️
OS-macOS 97.17% <100.00%> (-0.01%) ⬇️
Py-3.10.11 96.70% <100.00%> (-0.02%) ⬇️
Py-3.10.20 97.18% <100.00%> (-0.01%) ⬇️
Py-3.11.15 97.42% <100.00%> (-0.01%) ⬇️
Py-3.11.9 96.95% <100.00%> (+<0.01%) ⬆️
Py-3.12.10 97.03% <100.00%> (+<0.01%) ⬆️
Py-3.12.12 ?
Py-3.12.13 97.51% <100.00%> (?)
Py-3.13.12 97.73% <100.00%> (-0.01%) ⬇️
Py-3.14.3 97.78% <100.00%> (-0.01%) ⬇️
Py-3.14.3t 96.79% <100.00%> (-0.01%) ⬇️
Py-pypy3.11.13-7.3.20 96.84% <100.00%> (+<0.01%) ⬆️
VM-macos 97.17% <100.00%> (-0.01%) ⬇️
VM-ubuntu 97.99% <100.00%> (-0.02%) ⬇️
VM-windows 95.63% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Dreamsorcerer Dreamsorcerer merged commit 2b256cf into 3.14 Mar 16, 2026
38 of 39 checks passed
@Dreamsorcerer Dreamsorcerer deleted the patchback/backports/3.14/24cb8c9ca414dcda009717c0872019e62fc4ef3a/pr-12238 branch March 16, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants