Uh oh!
There was an error while loading. Please reload this page.
fix(fetch): report security details for resumed TLS sessions - #42331
Conversation
A resumed TLS session skips the server Certificate message, and Node does not restore the certificate from the cached session, so getPeerCertificate() returns an empty object. securityDetails() then reported NaN validFrom/validTo and no issuer/subjectName. Give each APIRequestContext its own http/https agent, and cache the certificate details observed during a full handshake by endpoint. The agent's session cache starts out empty, so the first connection to an endpoint is always a full handshake that populates the cache before any resumption can happen.
Test results for "tests 1"2 flaky51242 passed, 1233 skipped Merge workflow run. |
Test results for "MCP"4 failed 8119 passed, 1341 skipped Merge workflow run. |
Hi, I'm the Playwright bot and I took a first look at the CI failures. 🟢 The PR is clear — all four failures are pre-existing flakesThe MCP report's 4 failures are all known flaky tests with long histories on unrelated SHAs, and none of them exercise the fetch TLS security-details code this PR touches. The "tests 1" report has no real failures (2 flaky only). DetailsThis PR only changes Pre-existing flake / infra
Each of these fails and passes across many other runs and PRs, which is the flake signature — not something introduced here. The green "tests 1" run confirms the library suite (where this change actually lives, including the new Triaged by the Playwright bot - agent run |
8885923
into
microsoft:mainUh oh!
There was an error while loading. Please reload this page.
Summary
getPeerCertificate()returns{}andsecurityDetails()reportedNaNvalidFrom/validTowith noissuer/subjectName.createConnectionoverride that had been bypassing Node's TLS session cache entirely.APIRequestContextnow owns its http/https agent, and certificate details from a full handshake are cached per endpoint. The agent's session cache starts out empty, so the first connection to an endpoint is always a full handshake that populates the cache before any resumption can happen.Fixes the flaky
library/global-fetch.spec.ts:293andlibrary/har.spec.ts:639. Both have failed on the first attempt in ~100% of CI runs since #42240 landed on Aug 14, and passed on retry, so the runs stayed green.