Skip to content

Abstract API: add declarative TLS request option to AHC and DefaultHTTPClient#168

Open
nakulbajaj wants to merge 2 commits into
apple:mainfrom
nakulbajaj:declarative-tls
Open

Abstract API: add declarative TLS request option to AHC and DefaultHTTPClient#168
nakulbajaj wants to merge 2 commits into
apple:mainfrom
nakulbajaj:declarative-tls

Conversation

@nakulbajaj
Copy link
Copy Markdown
Member

Adding the declarative TLS request option to the abstract API and making sure AHC and thus DefaultHTTPClient support it for all platforms.

Longer term, we should also add an imperative option for cert validation.

//
//===----------------------------------------------------------------------===//

public import HTTPAPIs
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These imports are not necessary since they were already reexported

@available(anyAppleOS 26.0, *)
extension HTTPClientCapability {
/// A protocol for HTTP request options that support TLS policies.
public protocol DeclarativeTLS: RequestOptions {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Probably want to discuss the naming a bit more

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree both on the protocol name but also on the name of TrustEvaluationPolicy. We would normally call this ServerCertificateVerification

@nakulbajaj nakulbajaj added ⚠️ semver/major Breaks existing public API. and removed 🆕 semver/minor Adds new public API. labels May 21, 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