iOS reference / Network / TLSNetwork · IOS API REFERENCE
TLS struct · iOS 26.0+ · SDK 27.1
struct TLSThe system definition of the Transport Layer Security (TLS) protocol.
Supports sending and receiving encrypted byte streams.
Members (9) method · iOS 26.0+ cipherSuites TypeScript cipherSuites(suites: Array<_Security_tls_ciphersuite_t>): TLSSwift declaration func cipherSuites(_ suites: [tls_ciphersuite_t]) -> TLSSet TLS ciphersuites to the set of enabled ciphersuites.
- Parameter suites: The cipher suites to set.
method · iOS 26.0+ localIdentity TypeScript localIdentity(identity: Implements<_Security_OS_sec_identity> | SDKHandle): TLSSwift declaration func localIdentity(_ identity: sec_identity_t) -> TLSSet the local identity TLS uses during the handshake.
- Parameter identity: The local identity to be used during the TLS handshake.
method · iOS 26.0+ ticketsEnabled TypeScript ticketsEnabled(enabled: boolean): TLSSwift declaration func ticketsEnabled(_ enabled: Bool) -> TLSEnable TLS session ticket support.
- Parameter enabled: True if enabled, false otherwise.
method · iOS 26.0+ earlyDataEnabled TypeScript earlyDataEnabled(enabled: boolean): TLSSwift declaration func earlyDataEnabled(_ enabled: Bool) -> TLSEnable early data (0-RTT) for TLS.
> Warning: This may have security implications for application data.
In particular, TLS early data is replayable by a network attacker.
You must account for this when sending data before the handshake
is confirmed. See RFC 8446 for more information. You MUST NOT
enable fast open without a specific application profile that defines its use.
- Parameter enabled: True to enable early data, false otherwise.
method · iOS 26.0+ cipherSuiteGroups TypeScript cipherSuiteGroups(groups: Array<_Security_tls_ciphersuite_group_t>): TLSSwift declaration func cipherSuiteGroups(_ groups: [tls_ciphersuite_group_t]) -> TLSSet TLS ciphersuite groups to the set of enabled ciphersuites.
- Parameter groups: The cipher suite groups to set.
method · iOS 26.0+ peerAuthentication TypeScript peerAuthentication(preference: TLS_PeerAuthentication): TLSSwift declaration func peerAuthentication(_ preference: TLS.PeerAuthentication) -> TLSSpecify a preference for how to authenticate the peer.
- Parameter preference: The peer authentication preference.
method · iOS 26.0+ applicationProtocols TypeScript applicationProtocols(protocols: Array<string>): TLSSwift declaration func applicationProtocols(_ protocols: [String]) -> TLSSet application protocols supported by clients of this protocol.
Application layer protocol negotiation (ALPN) tokens
describe the application protocol in use above TLS.
- Parameters protocols: An array of application layer protocol
tokens to use for negotiation during the TLS handshake.
method · iOS 26.0+ version TypeScript version(min?: (_Security_tls_protocol_version_t) | null, max?: (_Security_tls_protocol_version_t) | null): TLSSwift declaration func version(min: tls_protocol_version_t? = nil, max: tls_protocol_version_t? = nil) -> TLSinit · iOS 26.0+ init TypeScript static init(): TLSSwift declaration init()Create a TLS protocol to use in a protocol stack.
Skipped declarations 2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
TLS.init(_:)
callback cannot propagate synchronous failure
TLS.certificateValidator(_:)
This Swift callback must itself suspend asynchronously. (nonthrowing, so a rejected promise cannot reach swift)
All Network types →