Repository navigation
Conversation
Exposes HTTPClient.Configuration.tlsLocalIdentityNetworkFramework: a thin passthrough into Network.framework's sec_protocol_options_set_local_identity, for direct (non-proxied) connections on Apple platforms. tlsConfiguration.certificateChain and .privateKey (the NIOSSL-shaped mTLS config) remain unsupported on this backend, same as before -- there's no public API to build a SecIdentity from raw bytes without a Keychain round-trip, so this hook takes an already-built SecIdentity rather than AsyncHTTPClient performing that round-trip itself. Tests cover both that the client certificate is actually presented to a server that requires one, and the negative control (connection rejected without it). Synthesizing a Keychain-backed SecIdentity inside an unsigned `swift test` process is itself unreliable -- the positive test skips rather than flakes when that round-trip can't complete, same limitation RequestDL's own RawBytesIdentityBuilder test suite already works around by only unit-testing its DER-parsing halves. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
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.
Summary
HTTPClient.Configuration.tlsLocalIdentityNetworkFramework: SecIdentity?— a thin passthrough into Network.framework'ssec_protocol_options_set_local_identity, for direct (non-proxied) connections on Apple platforms.tlsConfiguration.certificateChain/.privateKey(the NIOSSL-shaped mTLS config) remain unsupported on this backend, same as before — there is no public API to build aSecIdentityfrom raw bytes without a Keychain round-trip, so this hook takes an already-builtSecIdentityrather than AsyncHTTPClient performing that round-trip itself.tlsCustomVerificationnortlsCustomVerificationNetworkFrameworkfrom Add pluggable trust-verification hooks for NIOSSL and Network.framework #11, but was developed alongside them and merges cleanly with that work (see thereleaseintegration branch).Test plan
LocalIdentityNetworkFrameworkTests: negative control (server requiring a client cert rejects a connection with none) passes reliably; the positive test (client cert actually presented) passes on the NIOSSL backend and isXCTSkip'd on Network.framework when synthesizing a Keychain-backedSecIdentityinside an unsignedswift testprocess itself fails — the same limitationInternalsRawBytesIdentityBuilderTestsin request-dl-nio already works around by only unit-testing its DER-parsing halves, not the full Keychain round-trip.swift buildclean,swift format lint --strictclean.HTTPClientNIOTSTests/HTTPConnectionPool+FactoryTestsunaffected in both NIOSSL and Network.framework modes.🤖 Generated with Claude Code