Exercise the real handler chain in hosting service HTTPS tests.
Review Request #15187 — Created July 21, 2026 and updated — Latest diff uploaded
BuildSSLContextFromSSLCertTestsstubbed outOpenerDirector.open, so the
urlopen handler chain never ran andhttps_open()was never reached. The
tests then asserted against the SSL context the handler was constructed with,
which is not necessarily the one the request uses.That hid a real bug. The legacy
ssl_certfallback context was being
discarded inhttps_open(), and all three legacy tests passed anyway.These tests now stub
do_open()on the handler instead. The chain runs as far
as opening a connection, and the assertions look at the context handed to the
connection, which is the one that would reach the server. Each call to
ssl.create_default_context()gets its ownCaptureSSLContextso that a
rebuilt context doesn't accumulate state from the one it replaced.
- Reverted the
https_open()fix and confirmed
test_open_with_legacy_ssl_cert_hostname_mismatchfailed, where before it
passed against the same bug. - Ran unit tests for
reviewboard.certsandreviewboard.hostingsvcs.