-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Background and Motivation
#48956 raised the point that ListenOptions.UseHttps will be unusable in 8.0 for servers constructed without an IWebHostBuilder, since the extension method for registering IHttpsConfigurationService only applies to that type. If we'd prefer to avoid breaking such users, we could introduce a comparable extension method on IServiceCollection - that's all the IWebHostBuilder extension method does anyway.
Proposed API
namespace Microsoft.AspNetCore.Obscure;
public static class HttpsConfigurationServiceCollectionExtensions
{
+ public IServiceCollection UseKestrelHttpsConfiguration(this IServiceCollection serviceCollection);
}Usage Examples
serviceCollection.UseKestrelHttpsConfiguration();Alternative Designs
I suppose, hypothetically, we could expose more of the internal HTTPS configuration types directly and let consumers register them as they see fit, but that seems a lot more complicated and harder to maintain.
Risks
Users might be confused about the difference between IWebHostBuilder.UseKestrelHttpsConfiguration and IServiceCollection.UseKestrelHttpsConfiguration.