Skip to content

Early Data Support in URLSession #5216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,36 @@ open class URLSessionConfiguration : NSObject, NSCopying, @unchecked Sendable {
@available(*, unavailable, message: "Not available on non-Darwin platforms")
open var usesClassicLoadingMode: Bool { NSUnsupported() }

/* Enables HTTP/3 0-RTT early data transmission of safe requests (GET or HEAD
requests).

WARNING: Inclusion in TLS early data changes the security guarantees offered
by TLS.

Requests sent in early data are not covered by anti-replay security
protections. Early data must be idempotent and the impact of adversarial
replays must be carefully evaluated, as the data may be replayed. Early data
also does not provide full forward secrecy; data transmitted is more
susceptible to data breach and security compromise of the server, even if
the breach happens after the data was transmitted.

See Section 8 of RFC8446 for more details.

https://datatracker.ietf.org/doc/html/rfc8446#section-8

See RFC8470 for additional discussion and security considerations.

https://datatracker.ietf.org/doc/html/rfc8470

If these risks are acceptable for your use case, set this property to true.
If unsure, false is the safest option.

NOTE: Not supported in the classic loading mode.

Defaults to false.
*/
@available(*, unavailable, message: "Not available on non-Darwin platforms")
open var enablesEarlyData: Bool { NSUnsupported() }
}

@available(*, unavailable, message: "Not available on non-Darwin platforms")
Expand Down