Repository navigation
fix: net module requests proceed without a client certificate when server requests one - #52160
Closed
dannycochran wants to merge 1 commit into
Closed
dannycochran wants to merge 1 commit into
dannycochran wants to merge 1 commit into
Conversation
…rver requests one SimpleURLLoaderWrapper::OnCertificateRequested and URLLoaderNetworkObserver::OnCertificateRequested were inline empty stubs. When a server sends a TLS CertificateRequest, the network service delivers OnCertificateRequested to the URLLoaderNetworkServiceObserver and waits for a response on the ClientCertificateResponder; the empty stub drops the responder pipe, which the network service treats as a cancel and surfaces to net.request / net.fetch as ERR_SSL_CLIENT_AUTH_CERT_NEEDED. Respond with ContinueWithoutCertificate() so the handshake proceeds without presenting a client certificate, matching the behavior of fetch() in a renderer when no certificate is selected. Client-certificate selection for net-module requests is not addressed here; see electron#29984 for the follow-up. Refs electron#29984. Notes: Fixed `net.request` and `net.fetch` failing with `ERR_SSL_CLIENT_AUTH_CERT_NEEDED` when the server requests an optional client certificate; requests now proceed without presenting a certificate.
dannycochran
force-pushed
the
feat/net-select-client-certificate
branch
from
June 27, 2026 14:05
b559aec to
d885048
Compare
MarshallOfSound
left a comment
Member
There was a problem hiding this comment.
Should we let this actually choose a cert via e.g. https://www.electronjs.org/docs/latest/api/app#event-select-client-certificate
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.
Description of Change
See also #52162 for the full event-wiring approach.
net.request/net.fetchrequests to a server that sends a TLSCertificateRequest(e.g. nginxssl_verify_client optional) currently abort withERR_SSL_CLIENT_AUTH_CERT_NEEDED.SimpleURLLoaderWrapper::OnCertificateRequestedandURLLoaderNetworkObserver::OnCertificateRequestedare empty stubs; dropping theClientCertificateRespondermojo pipe causes the network service to treat the request as cancelled.This change makes both observers respond with
ContinueWithoutCertificate()so the TLS handshake proceeds without presenting a client certificate — the same behavior a rendererfetch()gets when no certificate is selected.Client certificate selection for
netmodule requests is tracked separately.Refs #29984.
Checklist
npm testpassesRelease Notes
Notes: Fixed
net.requestandnet.fetchfailing withERR_SSL_CLIENT_AUTH_CERT_NEEDEDwhen the server requests an optional client certificate; requests now proceed without presenting a certificate.