Repository navigation
feat: client certificate authentication (mTLS) (#58) - #81
Merged
fmazzant merged 1 commit intoNov 22, 2026
Merged
Conversation
…ed (#58) Add the ClientCertificateRequested event for servers that require a client certificate (mutual TLS). The app answers with an X509Certificate2 with its private key (plus optional intermediates), or continues without one; a deferral allows loading it asynchronously. Without a handler the platform default applies. - Android: WebViewClient.OnReceivedClientCertRequest; the key is passed to ClientCertRequest.Proceed as PKCS#8 (RSA or EC) with the chain. - iOS / Mac Catalyst: NSURLAuthenticationMethodClientCertificate challenge answered with an NSUrlCredential from a SecIdentity. - Windows: CoreWebView2.ClientCertificateRequested; the certificate is matched by thumbprint against the store certificates the server accepts, listed in AvailableCertificates. - Unit tests for issuer names, the store match and the key export; README section.
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.
Part of #58
Summary
ClientCertificateRequestedevent:Host,Port,AcceptableIssuers,AvailableCertificates(Windows store),Certificate(null = continue without),IntermediateCertificates,GetDeferral().OnReceivedClientCertRequest→ClientCertRequest.Proceedwith the PKCS#8 key (RSA/EC) and the chain;Ignore()when no certificate.NSURLAuthenticationMethodClientCertificate→NSUrlCredentialfromSecIdentity.Import.CoreWebView2.ClientCertificateRequested; the chosen certificate is matched by thumbprint againstMutuallyTrustedCertificates(WebView2 can only send store certificates).Tests
https://client.badssl.com/with the badssl.com client certificate.