File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/DefaultBuilder/test/Microsoft.AspNetCore.TrimmingTests Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
1
2
using System . Security . Cryptography . X509Certificates ;
2
3
using Microsoft . AspNetCore . Builder ;
3
4
using Microsoft . AspNetCore . Hosting ;
8
9
{
9
10
serverOptions . ListenLocalhost ( 5000 , listenOptions =>
10
11
{
11
- #pragma warning disable SYSLIB0026 // The constructor obsolete but we're not actually going to use the cert
12
- listenOptions . UseHttps ( new X509Certificate2 ( ) ) ;
13
- #pragma warning restore SYSLIB0026
12
+ listenOptions . UseHttps ( ) ;
14
13
} ) ;
15
14
} ) ;
16
15
17
- var app = builder . Build ( ) ;
16
+ try
17
+ {
18
+ _ = builder . Build ( ) ;
19
+ }
20
+ catch ( InvalidOperationException )
21
+ {
22
+ // Expected if there's no dev cert installed
23
+ }
18
24
19
25
if ( ! X509Utilities . HasCertificateType ) {
20
26
return 1 ;
You can’t perform that action at this time.
0 commit comments