Skip to content

Conversation

@hamzahrmalik
Copy link
Contributor

To mirror apple/swift-nio-ssl#545

This allows users to easily create a tls configuration for servers which want to do mtls, with reloading

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for this code please?

@aryan-25 aryan-25 added the 🆕 semver/minor Adds new public API. label Oct 21, 2025
@aryan-25 aryan-25 requested a review from Lukasa October 22, 2025 09:05
/// could not be loaded from the given paths.
public static func makeServerConfigurationWithMTLS(
certificateReloader: some CertificateReloader,
trustRoots: NIOSSLTrustRoots
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to default this to the system defaults?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this, but I suspect most mTLS applications would require clients to present a certificate that is anchored to some custom trust root, which is not likely to be a system default trust root. If this is the case then we shouldn't default the argument to system default trust roots.

The underlying NIOSSL function that this function mirrors also doesn't have a default argument.

cc @Lukasa

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we should not default this to the system trust roots, that will tend to be surprising.

@aryan-25 aryan-25 merged commit b87fdbf into apple:main Oct 23, 2025
36 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants