<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/DTLS",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network4DTLSV"
  },
  "title" : "DTLS"
}
-->

# DTLS

The system definition of the Datagram Transport Layer Security (DTLS) protocol.

```
struct DTLS
```

## Overview

Supports sending and receiving encrypted byte datagrams.

## Topics

### Initializers

[`init()`](/documentation/Network/DTLS/init())

Create a DTLS protocol to use in a protocol stack.

[`init(() -> UDP)`](/documentation/Network/DTLS/init(_:))

Create a DTLS protocol to use in a protocol stack.

### Instance Methods

[`func applicationProtocols([String]) -> DTLS`](/documentation/Network/DTLS/applicationProtocols(_:))

Set application protocols supported by clients of this protocol.

[`func certificateValidator((sec_protocol_metadata_t, sec_trust_t) async -> Bool) -> DTLS`](/documentation/Network/DTLS/certificateValidator(_:))

Set a closure to provide custom verification of the peer’s credentials during the DTLS handshake.

[`func cipherSuiteGroups([tls_ciphersuite_group_t]) -> DTLS`](/documentation/Network/DTLS/cipherSuiteGroups(_:))

Set DTLS ciphersuite groups to the set of enabled ciphersuites.

[`func cipherSuites([tls_ciphersuite_t]) -> DTLS`](/documentation/Network/DTLS/cipherSuites(_:))

Set DTLS ciphersuites to the set of enabled ciphersuites.

[`func earlyDataEnabled(Bool) -> DTLS`](/documentation/Network/DTLS/earlyDataEnabled(_:))

Enable early data (0-RTT) for DTLS.

[`func localIdentity(sec_identity_t) -> DTLS`](/documentation/Network/DTLS/localIdentity(_:))

Set the local identity DTLS uses during the handshake.

[`func peerAuthentication(DTLS.PeerAuthentication) -> DTLS`](/documentation/Network/DTLS/peerAuthentication(_:))

Specify a preference for how to authenticate the peer.

[`func ticketsEnabled(Bool) -> DTLS`](/documentation/Network/DTLS/ticketsEnabled(_:))

Enable DTLS session ticket support.

[`func version(min: tls_protocol_version_t?, max: tls_protocol_version_t?) -> DTLS`](/documentation/Network/DTLS/version(min:max:))

### Enumerations

[`enum PeerAuthentication`](/documentation/Network/DTLS/PeerAuthentication)

PeerAuthentication specifies how to authenticate the peer end
of the connection.

## Relationships

### Conforms To

[`NetworkProtocolOptions`](/documentation/Network/NetworkProtocolOptions)

[`DatagramProtocol`](/documentation/Network/DatagramProtocol)

[`MessageProtocol`](/documentation/Network/MessageProtocol)

[`OneToOneProtocol`](/documentation/Network/OneToOneProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)