- ios/Packages/ClientTLS: SecIdentity wrapper, PKCS12 importer (typed errors), keychain store
(AfterFirstUnlockThisDeviceOnly), pure MutualTLSChallengeResponder truth table, cross-platform
X.509 DER summary. 14/14 tests.
- Both transports (SessionCore URLSessionTermTransport, App URLSessionHTTPTransport) + SessionThumbnail
take a lazy @Sendable ()->ClientIdentity? provider: WS resolves per-connect, HTTP per client-cert
challenge, so a freshly-imported cert applies without an app relaunch. AppEnvironment injects
{ store.loadedIdentityOrNil() }.
- ClientCertScreen (.fileImporter([.pkcs12]) + passphrase -> import -> keychain), reachable via a
设备证书 entry in SessionListScreen.hostMenu. PairingViewModel gates tunnel-host probes on cert
presence and re-maps mTLS-reject to a clientCertRejected message.
Verified: ClientTLS 14/14, SessionCore 93/93, xcodegen + xcodebuild BUILD SUCCEEDED.
23 lines
835 B
Swift
23 lines
835 B
Swift
// swift-tools-version: 6.0
|
|
// C-iOS-1 · Device client-certificate (mutual-TLS) leaf package.
|
|
//
|
|
// Standalone, no local-package dependencies — imports ONLY Security/Foundation.
|
|
// It is a downward leaf: SessionCore and the App target may depend on it, it
|
|
// depends on nothing in this workspace. This keeps the pure, unit-testable
|
|
// mTLS logic (identity wrapper, PKCS#12 import, challenge responder) isolated
|
|
// from the WS/HTTP transport plumbing that consumes it.
|
|
import PackageDescription
|
|
|
|
let package = Package(
|
|
name: "ClientTLS",
|
|
platforms: [.iOS(.v17), .macOS(.v14)],
|
|
products: [
|
|
.library(name: "ClientTLS", targets: ["ClientTLS"]),
|
|
],
|
|
targets: [
|
|
.target(name: "ClientTLS"),
|
|
.testTarget(name: "ClientTLSTests", dependencies: ["ClientTLS"]),
|
|
],
|
|
swiftLanguageModes: [.v6]
|
|
)
|