@@ -30,20 +30,21 @@ public class KestrelServer : IServer
30
30
private int _stopping ;
31
31
private readonly TaskCompletionSource < object > _stoppedTcs = new TaskCompletionSource < object > ( ) ;
32
32
33
- public KestrelServer ( IOptions < KestrelServerOptions > options , ITransportFactory transportFactory , ILoggerFactory loggerFactory )
34
- : this ( transportFactory , CreateServiceContext ( options , loggerFactory ) )
33
+ public KestrelServer ( IOptions < KestrelServerOptions > options , ITransportFactory transportFactory , ILoggerFactory loggerFactory , IDefaultHttpsProvider defaultHttpsProvider )
34
+ : this ( transportFactory , defaultHttpsProvider , CreateServiceContext ( options , loggerFactory ) )
35
35
{
36
36
}
37
37
38
38
// For testing
39
- internal KestrelServer ( ITransportFactory transportFactory , ServiceContext serviceContext )
39
+ internal KestrelServer ( ITransportFactory transportFactory , IDefaultHttpsProvider defaultHttpsProvider , ServiceContext serviceContext )
40
40
{
41
41
if ( transportFactory == null )
42
42
{
43
43
throw new ArgumentNullException ( nameof ( transportFactory ) ) ;
44
44
}
45
45
46
46
_transportFactory = transportFactory ;
47
+ _defaultHttpsProvider = defaultHttpsProvider ;
47
48
ServiceContext = serviceContext ;
48
49
49
50
var httpHeartbeatManager = new HttpHeartbeatManager ( serviceContext . ConnectionManager ) ;
@@ -54,8 +55,6 @@ internal KestrelServer(ITransportFactory transportFactory, ServiceContext servic
54
55
Features = new FeatureCollection ( ) ;
55
56
_serverAddresses = new ServerAddressesFeature ( ) ;
56
57
Features . Set ( _serverAddresses ) ;
57
-
58
- _defaultHttpsProvider = serviceContext . ServerOptions . ApplicationServices . GetService < IDefaultHttpsProvider > ( ) ;
59
58
}
60
59
61
60
private static ServiceContext CreateServiceContext ( IOptions < KestrelServerOptions > options , ILoggerFactory loggerFactory )
0 commit comments