Repository navigation
Conversation
Exposes HTTPClient.Configuration.tlsCustomVerification (NIOSSL backend) and .tlsCustomVerificationNetworkFramework (Network.framework backend), thin passthroughs into NIOSSLClientHandler's customVerificationCallback and Network.framework's sec_protocol_options_set_verify_block respectively. Neither hook carries any built-in pinning policy — the goal is to let a caller (e.g. a TrustEvaluator implemented downstream) fully own the accept/reject decision on whichever TLS backend actually negotiates the connection, including inspecting the full presented chain rather than just the leaf. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks done
…oc comment Three double-backtick links in an unconditional doc comment pointed at symbols that don't exist in every build this repo's CI produces documentation for: tlsCustomVerificationNetworkFramework is canImport(Network)-gated (absent from the Linux symbol graph entirely), and TLSConfiguration.certificateVerification / NIOSSLCustomVerificationCallback both live in the NIOSSL module, which DocC can't resolve an unqualified cross-module link against in this build. Switched all three to plain code spans -- still readable, without a resolution DocC can't perform. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.tlsCustomVerification(NIOSSL backend) and.tlsCustomVerificationNetworkFramework(Network.framework backend): thin passthroughs intoNIOSSLClientHandler'scustomVerificationCallbackandsec_protocol_options_set_verify_blockrespectively.TrustEvaluatorimplemented downstream in request-dl-nio) fully own the accept/reject decision on whichever TLS backend actually negotiates the connection, including inspecting the full presented chain rather than just the leaf.tlsCustomVerificationoverrides NIOSSL's trust-chain verification only — hostname/SNI matching stays a separate gate onTLSConfiguration.certificateVerification(documented on the property).tlsCustomVerificationNetworkFrameworkreceives the realSecTrustNetwork.framework already built, so a conforming implementation can callSecTrustEvaluateWithErroritself to keep the OS's trust-store/revocation/Certificate-Transparency behavior before layering custom logic on top.Test plan
TrustCustomVerificationTests: accept/reject on both backends, a plumbing-only test forgetNWProtocolTLSOptions, and an mTLS-alongside-custom-verification test (client cert still presented whentlsCustomVerificationis also set) — verified in both NIOSSL and Network.framework modes (DISABLE_TS_TESTS=true/unset).swift buildclean,swift format lint --strictclean.HTTPClientNIOTSTests/HTTPConnectionPool+FactoryTests/SSLContextCacheTestsunaffected in both modes.🤖 Generated with Claude Code