One Logo Pool Ball
Network · IOS API REFERENCE

TLS

struct · iOS 26.0+ · SDK 27.1

struct TLS

The 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>): TLS
Swift declaration
func cipherSuites(_ suites: [tls_ciphersuite_t]) -> TLS

Set 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): TLS
Swift declaration
func localIdentity(_ identity: sec_identity_t) -> TLS

Set 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): TLS
Swift declaration
func ticketsEnabled(_ enabled: Bool) -> TLS

Enable TLS session ticket support. - Parameter enabled: True if enabled, false otherwise.

method · iOS 26.0+

earlyDataEnabled

TypeScript
earlyDataEnabled(enabled: boolean): TLS
Swift declaration
func earlyDataEnabled(_ enabled: Bool) -> TLS

Enable 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>): TLS
Swift declaration
func cipherSuiteGroups(_ groups: [tls_ciphersuite_group_t]) -> TLS

Set 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): TLS
Swift declaration
func peerAuthentication(_ preference: TLS.PeerAuthentication) -> TLS

Specify a preference for how to authenticate the peer. - Parameter preference: The peer authentication preference.

method · iOS 26.0+

applicationProtocols

TypeScript
applicationProtocols(protocols: Array<string>): TLS
Swift declaration
func applicationProtocols(_ protocols: [String]) -> TLS

Set 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): TLS
Swift declaration
func version(min: tls_protocol_version_t? = nil, max: tls_protocol_version_t? = nil) -> TLS
init · iOS 26.0+

init

TypeScript
static init(): TLS
Swift 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 →