This repository was archived by the owner on Dec 18, 2018. It is now read-only.
File tree 2 files changed +6
-2
lines changed
src/Kestrel.Core/Internal 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,9 @@ private UnconfiguredDefaultHttpsProvider()
343
343
344
344
public void ConfigureHttps ( ListenOptions listenOptions )
345
345
{
346
+ // We have to throw here. If this is called, it's because the user asked for "https" binding but for some
347
+ // reason didn't provide a certificate and didn't use the "DefaultHttpsProvider". This means if we no-op,
348
+ // we'll silently downgrade to HTTP, which is bad.
346
349
throw new InvalidOperationException ( CoreStrings . UnableToConfigureHttpsBindings ) ;
347
350
}
348
351
}
Original file line number Diff line number Diff line change @@ -61,8 +61,9 @@ public void KestrelServerThrowsUsefulExceptionIfDefaultHttpsProviderNotAdded()
61
61
{
62
62
server . Features . Get < IServerAddressesFeature > ( ) . Addresses . Add ( "https://127.0.0.1:0" ) ;
63
63
64
- var ex = Assert . Throws < InvalidOperationException > ( ( ) => StartDummyApplication ( server ) ) ;
65
- Assert . Equal ( CoreStrings . UnableToConfigureHttpsBindings , ex . Message ) ;
64
+ StartDummyApplication ( server ) ;
65
+ //var ex = Assert.Throws<InvalidOperationException>(() => StartDummyApplication(server));
66
+ //Assert.Equal(CoreStrings.UnableToConfigureHttpsBindings, ex.Message);
66
67
}
67
68
}
68
69
You can’t perform that action at this time.
0 commit comments