Repository navigation
Conversation
Offer X25519MLKEM768 with classical fallback on REST and WebSocket connections to the deployment. Electron before 44 does not offer it by default, and VS Code's default proxy support replaces our agent, so the groups go on each request: in ws options and an axios transport over follow-redirects. The group list is probed once because an unsupported name breaks every TLS connection.
EhabY
force-pushed
the
feat/post-quantum-key-exchange
branch
from
December 4, 2026 11:18
9ea43a2 to
e3c1ed8
Compare
EhabY
marked this pull request as ready for review
December 4, 2026 11:19
A refused cross-origin redirect carries the target hostname in its message, and the client certificate classifier matched alert names anywhere in a message. Match alert names only in TLS error shapes and skip errors caused by a refused redirect. The key exchange transport reads axios options as own properties, and a test covers its cross-origin redirect guard with the transport active.
EhabY
force-pushed
the
feat/post-quantum-key-exchange
branch
from
December 4, 2026 15:28
9af4655 to
911cf23
Compare
code-asher
approved these changes
Dec 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
REST and WebSocket connections to the deployment now offer the post-quantum hybrid key exchange
X25519MLKEM768, and fall back to classical groups when the server doesn't support it.Why
http.proxySupport: override, VS Code replaces the agent and keeps onlyca(Proxy agent ignores TLS options of an extension's agent when http.proxySupport is override microsoft/vscode#351963). Options on the request itself survive.How
src/api/keyExchange.tsprovides two pieces, used at three call sites:ecdhCurvein thewsoptionstransportoverfollow-redirectsthat setsecdhCurve, because axios has no per-request TLS options. It restores the redirect hooks axios skips for custom transports (maxRedirectsand our cross-origin guard).ProxyAgentecdhCurve, forhttp.proxySupporton/offAn unsupported group name makes every TLS connection throw, so
getEcdhCurve()tests the list once withtls.createSecureContext. If that fails, nothing is set.On Electron 44+ this sends the same groups Electron already sends, so the handshake is unchanged.
docs/ARCHITECTURE.mdand the module note that it can be deleted once our minimum VS Code ships Electron 44.follow-redirects(already installed through axios) is now a direct dependency.Also fixed: a refused cross-origin redirect could be reported as a TLS client certificate error (and trigger
coder.tlsCertRefreshCommand) when the target hostname spelled an alert name such ascertificate_expired. The classifier now matches alert names only in TLS error shapes and ignores refused redirects, which covers REST and WebSocket.Testing
test/unit/api/keyExchange.test.tsmakes real HTTPS and WebSocket handshakes against a server that only accepts P-521. BoringSSL never offers P-521 by default, so a connection succeeds only if our option reachestls.connect. The tests cover REST (with a redirect), WebSocket, and our own agent. Certificates are verified with the fixture CA. A cross-origin redirect test runs with the transport always active. Removing the wiring, the restored redirect guard, or the redirect check in the classifier each fails a test.Manual check on VS Code 1.149 / Electron 43, using VS Code's real proxy patch: axios negotiated
x25519before this change andX25519MLKEM768after. Electron 37.6 behaves the same, and Electron 44 already negotiatesX25519MLKEM768.Out of scope: the SSH tunnel, which runs through the Go CLI.
Decisions
tls.DEFAULT_ECDH_CURVE, which would affect every extension in the extension host.X25519MLKEM768:X25519:P-256:P-384matches Electron 44's default.maxRedirects: 0keeps axios's native transport and the runtime default. Nothing sets it today.Generated by Coder Agents on behalf of @EhabY.