File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,6 @@ scenarios:
100
100
variables :
101
101
httpSysUrlPrefix : " http://testserver:{{serverPort}}"
102
102
serverScheme : http
103
- httpOnly : true
104
103
load :
105
104
job : wrk
106
105
variables :
@@ -156,7 +155,6 @@ scenarios:
156
155
variables :
157
156
enableHostHeaderValidation : true
158
157
serverScheme : http
159
- httpOnly : true
160
158
load :
161
159
job : wrk
162
160
variables :
Original file line number Diff line number Diff line change 14
14
var certPublicKeyLength = certPublicKeySpecified ? certPublicKeyConfig : 2048 ;
15
15
var urlPrefix = builder . Configuration [ "httpSysUrlPrefix" ] ;
16
16
17
- // for investigation purposes you can disable https, but the point of TLS apps is to measure TLS scenarios
18
- var httpOnly = bool . TryParse ( builder . Configuration [ "httpOnly" ] , out var httpOnlyConfig ) && httpOnlyConfig ;
19
-
20
17
// endpoints
21
18
var listeningEndpoints = builder . Configuration [ "urls" ] ?? "https://localhost:5000/" ;
22
19
var httpsIpPort = listeningEndpoints . Split ( ";" ) . FirstOrDefault ( x => x . Contains ( "https" ) ) ? . Replace ( "https://" , "" ) ;
20
+ var httpOnly = httpsIpPort is null ; // in case TLS is disabled. Only for debug purposes - this app is designed to measure TLS scenario
21
+ if ( httpOnly )
22
+ {
23
+ Console . WriteLine ( "[Note] Server scheme is HTTP, not HTTPS." ) ;
24
+ }
23
25
24
26
// debug
25
27
var writeCertValidationEventsToConsole = bool . TryParse ( builder . Configuration [ "certValidationConsoleEnabled" ] , out var certValidationConsoleEnabled ) && certValidationConsoleEnabled ;
Original file line number Diff line number Diff line change 21
21
var certPublicKeySpecified = int . TryParse ( builder . Configuration [ "certPublicKeyLength" ] , out var certPublicKeyConfig ) ;
22
22
var certPublicKeyLength = certPublicKeySpecified ? certPublicKeyConfig : 2048 ;
23
23
var enableHostHeaderValidation = bool . TryParse ( builder . Configuration [ "enableHostHeaderValidation" ] , out var enableHostHeaderValidationConfig ) && enableHostHeaderValidationConfig ;
24
-
25
- // for investigation purposes you can disable https, but the point of TLS apps is to measure TLS scenarios
26
- var httpOnly = bool . TryParse ( builder . Configuration [ "httpOnly" ] , out var httpOnlyConfig ) && httpOnlyConfig ;
24
+ var supportedTlsVersions = ParseSslProtocols ( builder . Configuration [ "tlsProtocols" ] ) ;
27
25
28
26
// endpoints
29
27
var listeningEndpoints = builder . Configuration [ "urls" ] ?? "https://localhost:5000/" ;
30
- var supportedTlsVersions = ParseSslProtocols ( builder . Configuration [ "tlsProtocols" ] ) ;
28
+
29
+ // determine if listening is expected only on HTTP scheme
30
+ var httpOnly = true ;
31
+ foreach ( var endpoint in listeningEndpoints . Split ( [ ';' ] , StringSplitOptions . RemoveEmptyEntries ) )
32
+ {
33
+ var urlPrefix = UrlPrefix . Create ( endpoint ) ;
34
+ if ( urlPrefix . Scheme == "https" )
35
+ {
36
+ httpOnly = false ;
37
+ }
38
+ }
39
+ if ( httpOnly )
40
+ {
41
+ Console . WriteLine ( "[Note] Server scheme is HTTP, not HTTPS." ) ;
42
+ }
31
43
32
44
// debug
33
45
var writeCertValidationEventsToConsole = bool . TryParse ( builder . Configuration [ "certValidationConsoleEnabled" ] , out var certValidationConsoleEnabled ) && certValidationConsoleEnabled ;
You can’t perform that action at this time.
0 commit comments