Skip to content

Make SwiftTLSOptions Sendable - #25

Open
rnro wants to merge 1 commit into
apple:mainfrom
rnro:sendable_options
Open

rnro wants to merge 1 commit into
apple:mainfrom
rnro:sendable_options

Conversation

@rnro

@rnro rnro commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Options are configured on one thread and read by the handshake on another, so a client holding SwiftTLSOptions in a Sendable type needs them to be Sendable. Every field already is, except the opaque-key signing callback, which the handshake invokes from its own context.

  • Made SwiftTLSRefKeySignCallback @Sendable.
  • Declared Sendable on SwiftTLSOptions, SwiftTLSPrivateKey and SwiftTLSOpaqueReferenceKey, along with the nested option types.
  • Captured the signing keys in the test callbacks rather than self.

This will be an SPI-breaking change, SemVer major.

Options are configured on one thread and read by the handshake on another, so a
client holding `SwiftTLSOptions` in a `Sendable` type needs them to be
`Sendable`. Every field already is, except the opaque-key signing callback,
which the handshake invokes from its own context.

* Made `SwiftTLSRefKeySignCallback` `@Sendable`.
* Declared `Sendable` on `SwiftTLSOptions`, `SwiftTLSPrivateKey` and
  `SwiftTLSOpaqueReferenceKey`, along with the nested option types.
* Captured the signing keys in the test callbacks rather than `self`.
@rnro rnro added the ⚠️ semver/major Breaks existing public API. label Oct 5, 2026
@rnro rnro added ⚠️ semver/major Breaks existing public API. and removed ⚠️ semver/major Breaks existing public API. labels Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ semver/major Breaks existing public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants