Skip to content

Conversation

@feiyun0112
Copy link
Contributor

fix #64860

Copilot AI review requested due to automatic review settings December 26, 2025 02:57
@github-actions github-actions bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Dec 26, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 26, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new UseHttps() overload that allows configuring Kestrel to use HTTPS with both HttpsConnectionAdapterOptions and TlsHandshakeCallbackOptions simultaneously. This enables combining standard HTTPS options (like client certificate validation and TLS client hello callbacks) with per-connection callbacks for dynamic SSL/TLS configuration.

Key changes:

  • New UseHttps() extension method accepting both option types
  • New HttpsConnectionMiddleware constructor that merges functionality from both option types
  • Comprehensive test coverage including functional tests and null parameter validation

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Servers/Kestrel/Core/src/ListenOptionsHttpsExtensions.cs Adds new public extension method UseHttps(HttpsConnectionAdapterOptions, TlsHandshakeCallbackOptions) with parameter validation and middleware setup
src/Servers/Kestrel/Core/src/Middleware/HttpsConnectionMiddleware.cs Adds new internal constructor that combines both option types, enabling certificate validation callbacks and TLS client hello callbacks alongside per-connection SSL options
src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs Adds five tests covering: combined options functionality, basic scenario, and null parameter validation
src/Servers/Kestrel/Core/src/PublicAPI.Shipped.txt Documents the new public API surface

The implementation is well-structured and follows existing patterns in the codebase. The tests provide comprehensive coverage of the new functionality, and all parameter validation is properly implemented.

@gfoidl
Copy link
Member

gfoidl commented Dec 26, 2025

Thanks for the contribution, but this PR is changing the public API, and according the api review process there should be a discussion about the change first.

So I suggest to put the PR on hold (set it to draft) until the review is done, then the PR can be continued. As said, thanks for your work here!

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions community-contribution Indicates that the PR has been added by a community member pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No API to set both HttpsConnectionAdapterOptions and TlsHandshakeCallbackOptions

2 participants