<!--
{
  "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/earlyDataEnabled(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network4DTLSV16earlyDataEnabledyACSbF"
  },
  "title" : "earlyDataEnabled(_:)"
}
-->

# earlyDataEnabled(_:)

Enable early data (0-RTT) for DTLS.

```
func earlyDataEnabled(_ enabled: Bool) -> DTLS
```

## Parameters

`enabled`

True to enable early data, false otherwise.

## Discussion> Warning: This may have security implications for application data.
> In particular, DTLS 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.

---

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)