Skip to content

fix: net module requests proceed without a client certificate when server requests one - #52160

Closed
dannycochran wants to merge 1 commit into
electron:mainfrom
dannycochran:feat/net-select-client-certificate
Closed

dannycochran wants to merge 1 commit into
electron:mainfrom
dannycochran:feat/net-select-client-certificate

Conversation

@dannycochran

@dannycochran dannycochran commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Description of Change

See also #52162 for the full event-wiring approach.

net.request / net.fetch requests to a server that sends a TLS CertificateRequest (e.g. nginx ssl_verify_client optional) currently abort with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. SimpleURLLoaderWrapper::OnCertificateRequested and URLLoaderNetworkObserver::OnCertificateRequested are empty stubs; dropping the ClientCertificateResponder mojo 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 renderer fetch() gets when no certificate is selected.

Client certificate selection for net module requests is tracked separately.

Refs #29984.

Checklist

Release Notes

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.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jun 27, 2026
@dannycochran
dannycochran requested a review from a team as a code owner June 27, 2026 13:51
…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
dannycochran force-pushed the feat/net-select-client-certificate branch from b559aec to d885048 Compare June 27, 2026 14:05
@dannycochran dannycochran changed the title feat: emit select-client-certificate for net module requests fix: net module requests proceed without a client certificate when server requests one Jun 27, 2026

@MarshallOfSound MarshallOfSound left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-pr 🌱 PR opened recently

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants