354 references to HttpProtocols
Aspire.Dashboard (4)
DashboardWebApplication.cs (4)
486
AddEndpointConfiguration(initialValues, "OtlpGrpc", otlpGrpcAddress.ToString(),
HttpProtocols
.Http2, requiredClientCertificate: dashboardOptions.Otlp.AuthMode == OtlpAuthMode.ClientCertificate);
490
AddEndpointConfiguration(initialValues, "OtlpHttp", otlpHttpAddress.ToString(),
HttpProtocols
.Http1AndHttp2, requiredClientCertificate: dashboardOptions.Otlp.AuthMode == OtlpAuthMode.ClientCertificate);
512
AddEndpointConfiguration(initialValues, "OtlpGrpc", url!,
HttpProtocols
.Http1AndHttp2, requiredClientCertificate: dashboardOptions.Otlp.AuthMode == OtlpAuthMode.ClientCertificate);
515
static void AddEndpointConfiguration(Dictionary<string, string?> values, string endpointName, string url,
HttpProtocols
? protocols = null, bool requiredClientCertificate = false)
Aspire.Dashboard.Tests (1)
Integration\DashboardClientAuthTests.cs (1)
101
options.Protocols =
HttpProtocols
.Http2;
Aspire.Hosting (3)
Dashboard\DashboardServiceHost.cs (1)
164
options.Protocols =
HttpProtocols
.Http2;
ProjectResourceBuilderExtensions.cs (2)
360
var isHttp2ConfiguredInKestrelEndpointDefaults = config["Kestrel:EndpointDefaults:Protocols"] == nameof(
HttpProtocols
.Http2);
365
e.Transport = bindingLevelProtocols == nameof(
HttpProtocols
.Http2) ? "http2" : e.Transport;
Http2SampleApp (3)
Program.cs (3)
34
listenOptions.Protocols =
HttpProtocols
.Http1;
40
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2;
66
listenOptions.Protocols =
HttpProtocols
.Http2;
Http3SampleApp (7)
Program.cs (7)
35
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2;
49
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3;
56
listenOptions.Protocols =
HttpProtocols
.Http3;
67
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3;
78
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2;
93
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2;
111
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2;
InMemory.FunctionalTests (57)
EventSourceTests.cs (1)
159
listenOptions.Protocols =
HttpProtocols
.Http2;
Http2\Http2EndToEndTests.cs (1)
43
listenOptions.Protocols =
HttpProtocols
.Http2;
Http2\TlsTests.cs (1)
52
listenOptions.Protocols =
HttpProtocols
.Http2;
HttpProtocolSelectionTests.cs (6)
22
return TestError<InvalidOperationException>(
HttpProtocols
.None, CoreStrings.EndPointRequiresAtLeastOneProtocol);
28
return TestSuccess(
HttpProtocols
.Http1AndHttp2, "GET / HTTP/1.1\r\nHost:\r\n\r\n", "HTTP/1.1 200 OK");
34
return TestSuccess(
HttpProtocols
.Http1, "GET / HTTP/1.1\r\nHost:\r\n\r\n", "HTTP/1.1 200 OK");
54
return TestSuccess(
HttpProtocols
.Http2,
59
private async Task TestSuccess(
HttpProtocols
serverProtocols, string request, string expectedResponse)
77
private async Task TestError<TException>(
HttpProtocols
serverProtocols, string expectedErrorMessage)
HttpsConnectionMiddlewareTests.cs (25)
499
[InlineData(
HttpProtocols
.Http1)]
500
[InlineData(
HttpProtocols
.Http1AndHttp2)] // Make sure Http/1.1 doesn't regress with Http/2 enabled.
501
public async Task CertificatePassedToHttpContext(
HttpProtocols
httpProtocols)
541
listenOptions.Protocols =
HttpProtocols
.Http1;
576
[InlineData(
HttpProtocols
.Http1)]
577
[InlineData(
HttpProtocols
.Http1AndHttp2)] // Make sure turning on Http/2 doesn't regress HTTP/1
581
public async Task CanRenegotiateForClientCertificate(
HttpProtocols
httpProtocols)
626
listenOptions.Protocols =
HttpProtocols
.Http1;
759
listenOptions.Protocols =
HttpProtocols
.Http1;
883
listenOptions.Protocols =
HttpProtocols
.Http1;
1020
listenOptions.Protocols =
HttpProtocols
.Http1;
1067
listenOptions.Protocols =
HttpProtocols
.Http1;
1380
[InlineData(
HttpProtocols
.Http1)]
1381
[InlineData(
HttpProtocols
.Http2)]
1382
[InlineData(
HttpProtocols
.Http1AndHttp2)]
1385
public async Task ListenOptionsProtolsCanBeSetAfterUseHttps(
HttpProtocols
httpProtocols)
1407
httpProtocols.HasFlag(
HttpProtocols
.Http2) ?
1422
var middleware = CreateMiddleware(httpConnectionAdapterOptions,
HttpProtocols
.Http1AndHttp2);
1424
Assert.Equal(
HttpProtocols
.Http1, middleware._httpProtocols);
1436
var middleware = CreateMiddleware(httpConnectionAdapterOptions,
HttpProtocols
.Http1AndHttp2);
1438
Assert.Equal(
HttpProtocols
.Http1AndHttp2, middleware._httpProtocols);
1451
Assert.Throws<NotSupportedException>(() => CreateMiddleware(httpConnectionAdapterOptions,
HttpProtocols
.Http2));
1465
CreateMiddleware(httpConnectionAdapterOptions,
HttpProtocols
.Http2);
1477
private static HttpsConnectionMiddleware CreateMiddleware(HttpsConnectionAdapterOptions options,
HttpProtocols
httpProtocols, TestApplicationErrorLogger testLogger = null)
1483
private static HttpsConnectionMiddleware CreateMiddleware(HttpsConnectionAdapterOptions options,
HttpProtocols
httpProtocols)
HttpsTests.cs (6)
447
listenOptions.Protocols =
HttpProtocols
.Http3;
491
listenOptions.Protocols =
HttpProtocols
.Http3;
532
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3;
568
listenOptions.Protocols =
HttpProtocols
.Http3;
603
listenOptions.Protocols =
HttpProtocols
.Http3;
649
listenOptions.Protocols =
HttpProtocols
.Http3;
KestrelMetricsTests.cs (5)
549
listenOptions.Protocols =
HttpProtocols
.Http2;
627
listenOptions.Protocols =
HttpProtocols
.Http2;
697
listenOptions.Protocols =
HttpProtocols
.Http2;
782
listenOptions.Protocols =
HttpProtocols
.Http2;
866
listenOptions.Protocols =
HttpProtocols
.Http2;
ResponseTests.cs (7)
4379
Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3
4412
Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3,
4449
Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3,
4478
new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) { Protocols =
HttpProtocols
.Http1 }))
4507
Protocols =
HttpProtocols
.Http1
4511
Protocols =
HttpProtocols
.Http3,
4547
Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3,
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
237
HttpProtocols
.Http3,
src\Servers\Kestrel\shared\test\TestContextFactory.cs (4)
61
HttpProtocols
.Http1,
91
HttpProtocols
.Http3,
156
protocols:
HttpProtocols
.Http2,
206
protocols:
HttpProtocols
.Http3,
Interop.FunctionalTests (95)
H2SpecTests.cs (1)
38
listenOptions.Protocols =
HttpProtocols
.Http2;
Http2\Http2RequestTests.cs (6)
35
protocol:
HttpProtocols
.Http2,
108
listenOptions.Protocols =
HttpProtocols
.Http2;
174
protocol:
HttpProtocols
.Http2,
202
var builder = CreateHostBuilder(c => Task.CompletedTask, protocol:
HttpProtocols
.Http2, plaintext: true);
258
protocol:
HttpProtocols
.Http2,
326
private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate,
HttpProtocols
? protocol = null, Action<KestrelServerOptions> configureKestrel = null, bool? plaintext = null)
Http2WebSocketInteropTests.cs (12)
28
new object[] { "http", "1.1", HttpVersionPolicy.RequestVersionExact,
HttpProtocols
.Http1, "HTTP/1.1" },
29
new object[] { "http", "2.0", HttpVersionPolicy.RequestVersionExact,
HttpProtocols
.Http2, "HTTP/2" },
30
new object[] { "http", "1.1", HttpVersionPolicy.RequestVersionOrHigher,
HttpProtocols
.Http1AndHttp2, "HTTP/1.1" }, // No TLS/APLN, Can't upgrade
31
new object[] { "http", "2.0", HttpVersionPolicy.RequestVersionOrLower,
HttpProtocols
.Http1AndHttp2, "HTTP/1.1" }, // No TLS/APLN, Downgrade
36
list.Add(new object[] { "https", "1.1", HttpVersionPolicy.RequestVersionExact,
HttpProtocols
.Http1, "HTTP/1.1" });
37
list.Add(new object[] { "https", "2.0", HttpVersionPolicy.RequestVersionExact,
HttpProtocols
.Http2, "HTTP/2" });
38
list.Add(new object[] { "https", "1.1", HttpVersionPolicy.RequestVersionOrHigher,
HttpProtocols
.Http1AndHttp2, "HTTP/2" }); // Upgrade
39
list.Add(new object[] { "https", "2.0", HttpVersionPolicy.RequestVersionOrLower,
HttpProtocols
.Http1AndHttp2, "HTTP/2" });
40
list.Add(new object[] { "https", "2.0", HttpVersionPolicy.RequestVersionOrLower,
HttpProtocols
.Http1, "HTTP/1.1" }); // Downgrade
49
public async Task HttpVersionNegotationWorks(string scheme, string clientVersion, HttpVersionPolicy clientPolicy,
HttpProtocols
serverProtocols, string expectedVersion)
104
ConfigureKestrel(webHostBuilder, "https",
HttpProtocols
.Http2);
174
private static void ConfigureKestrel(IWebHostBuilder webHostBuilder, string scheme,
HttpProtocols
protocols)
Http3\Http3RequestTests.cs (59)
122
[InlineData(
HttpProtocols
.Http3)]
123
[InlineData(
HttpProtocols
.Http2)]
124
public async Task GET_MiddlewareIsRunWithConnectionLoggingScopeForHttpRequests(
HttpProtocols
protocol)
228
[InlineData(
HttpProtocols
.Http3, 11)]
229
[InlineData(
HttpProtocols
.Http3, 1024)]
230
[InlineData(
HttpProtocols
.Http2, 11)]
231
[InlineData(
HttpProtocols
.Http2, 1024)]
232
public async Task GET_ServerStreaming_ClientReadsPartialResponse(
HttpProtocols
protocol, int clientBufferSize)
274
[InlineData(
HttpProtocols
.Http3)]
275
[InlineData(
HttpProtocols
.Http2)]
276
public async Task POST_ClientSendsOnlyHeaders_RequestReceivedOnServer(
HttpProtocols
protocol)
319
[InlineData(
HttpProtocols
.Http3)]
320
[InlineData(
HttpProtocols
.Http2)]
321
public async Task POST_MultipleRequests_PooledStreamAndHeaders(
HttpProtocols
protocol)
345
if (protocol ==
HttpProtocols
.Http3)
369
static async Task<HttpResponseMessage> SendRequestAsync(
HttpProtocols
protocol, IHost host, HttpMessageInvoker client)
449
[InlineData(
HttpProtocols
.Http3)]
450
[InlineData(
HttpProtocols
.Http2)]
451
public async Task POST_ClientCancellationUpload_RequestAbortRaised(
HttpProtocols
protocol)
531
[InlineData(
HttpProtocols
.Http3)]
532
[InlineData(
HttpProtocols
.Http2)]
533
public async Task POST_ServerAbort_ClientReceivesAbort(
HttpProtocols
protocol)
574
if (protocol ==
HttpProtocols
.Http3)
608
}, protocol:
HttpProtocols
.Http3);
620
request.Version = GetProtocol(
HttpProtocols
.Http3);
649
[InlineData(
HttpProtocols
.Http3)]
650
[InlineData(
HttpProtocols
.Http2)]
651
public async Task GET_ServerAbort_ClientReceivesAbort(
HttpProtocols
protocol)
683
if (protocol ==
HttpProtocols
.Http3)
747
private static Version GetProtocol(
HttpProtocols
protocol)
751
case
HttpProtocols
.Http2:
753
case
HttpProtocols
.Http3:
900
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3;
962
[InlineData(
HttpProtocols
.Http3)]
963
[InlineData(
HttpProtocols
.Http2)]
965
public async Task POST_ClientCancellationBidirectional_RequestAbortRaised(
HttpProtocols
protocol)
1064
[InlineData(
HttpProtocols
.Http3)]
1065
[InlineData(
HttpProtocols
.Http2)]
1066
public async Task POST_Bidirectional_LargeData_Cancellation_Error(
HttpProtocols
protocol)
1158
[InlineData(
HttpProtocols
.Http3)]
1159
[InlineData(
HttpProtocols
.Http2)]
1160
public async Task ApplicationWriteWhenConnectionClosesPreservesMemory(
HttpProtocols
protocol)
1285
[InlineData(
HttpProtocols
.Http3)]
1286
[InlineData(
HttpProtocols
.Http2)]
1287
public async Task GET_ClientCancellationAfterResponseHeaders_RequestAbortRaised(
HttpProtocols
protocol)
1589
listenOptions.Protocols =
HttpProtocols
.Http3;
1640
listenOptions.Protocols =
HttpProtocols
.Http3;
1693
listenOptions.Protocols =
HttpProtocols
.Http3;
1862
listenOptions.Protocols =
HttpProtocols
.Http3;
1985
[InlineData(
HttpProtocols
.Http3)]
1986
[InlineData(
HttpProtocols
.Http2)]
1988
public async Task GET_GracefulServerShutdown_AbortRequestsAfterHostTimeout(
HttpProtocols
protocol)
2060
if (protocol ==
HttpProtocols
.Http3)
2089
if (protocol ==
HttpProtocols
.Http3)
2106
[InlineData(
HttpProtocols
.Http3)]
2107
[InlineData(
HttpProtocols
.Http2)]
2109
public async Task GET_GracefulServerShutdown_RequestCompleteSuccessfullyInsideHostTimeout(
HttpProtocols
protocol)
2193
request.Version = GetProtocol(
HttpProtocols
.Http3);
2203
private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate,
HttpProtocols
? protocol = null, Action<KestrelServerOptions> configureKestrel = null, TimeSpan? shutdownTimeout = null)
Http3\Http3TlsTests.cs (12)
37
listenOptions.Protocols =
HttpProtocols
.Http3;
88
listenOptions.Protocols =
HttpProtocols
.Http3;
130
listenOptions.Protocols =
HttpProtocols
.Http3;
175
listenOptions.Protocols =
HttpProtocols
.Http3;
229
listenOptions.Protocols =
HttpProtocols
.Http3;
257
[InlineData(
HttpProtocols
.Http3)]
258
[InlineData(
HttpProtocols
.Http1AndHttp2AndHttp3)]
259
public async Task OnAuthenticate_Available_Throws(
HttpProtocols
protocols)
300
listenOptions.Protocols =
HttpProtocols
.Http3;
354
listenOptions.Protocols =
HttpProtocols
.Http3;
456
listenOptions.Protocols =
HttpProtocols
.Http3;
516
private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate,
HttpProtocols
? protocol = null, Action<KestrelServerOptions> configureKestrel = null)
HttpClientHttp2InteropTests.cs (3)
1608
listenOptions.Protocols =
HttpProtocols
.Http2;
1653
listenOptions.Protocols =
HttpProtocols
.Http2;
1712
listenOptions.Protocols =
HttpProtocols
.Http2;
HttpHelpers.cs (2)
66
public static IHostBuilder CreateHostBuilder(Action<IServiceCollection> configureServices, RequestDelegate requestDelegate,
HttpProtocols
? protocol = null, Action<KestrelServerOptions> configureKestrel = null, bool? plaintext = null, TimeSpan? shutdownTimeout = null)
78
listenOptions.Protocols = protocol ??
HttpProtocols
.Http3;
InteropWebsite (1)
Program.cs (1)
62
listenOptions.Protocols =
HttpProtocols
.Http2;
Kestrel.SampleApp (1)
Startup.cs (1)
108
listenOptions.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.
HttpProtocols
.Http1;
Microsoft.AspNetCore.Server.Kestrel.Core (64)
Internal\BaseHttpConnectionContext.cs (2)
16
HttpProtocols
protocols,
39
public
HttpProtocols
Protocols { get; }
Internal\ConfigurationReader.cs (6)
176
private static
HttpProtocols
? ParseProtocols(string? protocols)
178
if (Enum.TryParse<
HttpProtocols
>(protocols, ignoreCase: true, out
var
result))
242
public
HttpProtocols
? Protocols { get; set; }
296
public
HttpProtocols
? Protocols { get; set; }
340
public
HttpProtocols
? Protocols { get; set; }
Internal\Http2\Http2StreamContext.cs (1)
17
HttpProtocols
protocols,
Internal\Http3\Http3Connection.cs (1)
663
HttpProtocols
.Http3,
Internal\Http3\Http3StreamContext.cs (1)
17
HttpProtocols
protocols,
Internal\HttpConnection.cs (14)
68
case
HttpProtocols
.Http1:
74
case
HttpProtocols
.Http2:
82
case
HttpProtocols
.Http3:
87
case
HttpProtocols
.None:
213
private
HttpProtocols
SelectProtocol()
219
var http1Enabled = _context.Protocols.HasFlag(
HttpProtocols
.Http1);
220
var http2Enabled = _context.Protocols.HasFlag(
HttpProtocols
.Http2);
221
var http3Enabled = _context.Protocols.HasFlag(
HttpProtocols
.Http3);
225
if (_context.Protocols ==
HttpProtocols
.None)
234
return
HttpProtocols
.Http3;
248
return
HttpProtocols
.None;
254
return
HttpProtocols
.Http1;
257
return http2Enabled && (!hasTls || Http2Id.SequenceEqual(applicationProtocol.Span)) ?
HttpProtocols
.Http2 :
HttpProtocols
.Http1;
Internal\HttpConnectionContext.cs (1)
17
HttpProtocols
protocols,
Internal\HttpMultiplexedConnectionContext.cs (1)
16
HttpProtocols
protocols,
Internal\HttpProtocolsFeature.cs (2)
8
public HttpProtocolsFeature(
HttpProtocols
httpProtocols)
13
public
HttpProtocols
HttpProtocols { get; }
Internal\Infrastructure\HttpUtilities.cs (4)
602
public static AltSvcHeader? GetEndpointAltSvc(System.Net.IPEndPoint endpoint,
HttpProtocols
protocols)
604
var hasHttp1OrHttp2 = protocols.HasFlag(
HttpProtocols
.Http1) || protocols.HasFlag(
HttpProtocols
.Http2);
605
var hasHttp3 = protocols.HasFlag(
HttpProtocols
.Http3);
Internal\KestrelServerImpl.cs (4)
137
var hasHttp1 = options.Protocols.HasFlag(
HttpProtocols
.Http1);
138
var hasHttp2 = options.Protocols.HasFlag(
HttpProtocols
.Http2);
139
var hasHttp3 = options.Protocols.HasFlag(
HttpProtocols
.Http3);
185
|| options.Protocols ==
HttpProtocols
.None) // TODO a test fails because it doesn't throw an exception in the right place
Internal\SniOptionsSelector.cs (4)
37
HttpProtocols
fallbackHttpProtocols,
94
var
httpProtocols = sniConfig.Protocols ?? fallbackHttpProtocols;
207
public SniOptions(SslServerAuthenticationOptions sslOptions,
HttpProtocols
httpProtocols, ClientCertificateMode clientCertificateMode)
215
public
HttpProtocols
HttpProtocols { get; }
ListenOptions.cs (4)
19
internal const
HttpProtocols
DefaultHttpProtocols =
HttpProtocols
.Http1AndHttp2;
23
private
HttpProtocols
_protocols = DefaultHttpProtocols;
99
public
HttpProtocols
Protocols
Middleware\HttpConnectionBuilderExtensions.cs (2)
11
public static IConnectionBuilder UseHttpServer<TContext>(this IConnectionBuilder builder, ServiceContext serviceContext, IHttpApplication<TContext> application,
HttpProtocols
protocols, bool addAltSvcHeader) where TContext : notnull
20
public static IMultiplexedConnectionBuilder UseHttp3Server<TContext>(this IMultiplexedConnectionBuilder builder, ServiceContext serviceContext, IHttpApplication<TContext> application,
HttpProtocols
protocols, bool addAltSvcHeader) where TContext : notnull
Middleware\HttpConnectionMiddleware.cs (3)
17
private readonly
HttpProtocols
_endpointDefaultProtocols;
20
public HttpConnectionMiddleware(ServiceContext serviceContext, IHttpApplication<TContext> application,
HttpProtocols
protocols, bool addAltSvcHeader)
31
var
protocols = connectionContext.Features.Get<HttpProtocolsFeature>()?.HttpProtocols ?? _endpointDefaultProtocols;
Middleware\HttpMultiplexedConnectionMiddleware.cs (2)
17
private readonly
HttpProtocols
_protocols;
20
public HttpMultiplexedConnectionMiddleware(ServiceContext serviceContext, IHttpApplication<TContext> application,
HttpProtocols
protocols, bool addAltSvcHeader)
Middleware\HttpsConnectionMiddleware.cs (11)
48
internal readonly
HttpProtocols
_httpProtocols;
53
public HttpsConnectionMiddleware(ConnectionDelegate next, HttpsConnectionAdapterOptions options,
HttpProtocols
httpProtocols, KestrelMetrics metrics)
58
public HttpsConnectionMiddleware(ConnectionDelegate next, HttpsConnectionAdapterOptions options,
HttpProtocols
httpProtocols, ILoggerFactory loggerFactory, KestrelMetrics metrics)
357
internal static void ConfigureAlpn(SslServerAuthenticationOptions serverOptions,
HttpProtocols
httpProtocols)
362
if ((httpProtocols &
HttpProtocols
.Http2) != 0)
369
if ((httpProtocols &
HttpProtocols
.Http1) != 0)
495
internal static
HttpProtocols
ValidateAndNormalizeHttpProtocols(
HttpProtocols
httpProtocols, ILogger<HttpsConnectionMiddleware> logger)
498
if (httpProtocols ==
HttpProtocols
.Http2)
509
else if (httpProtocols ==
HttpProtocols
.Http1AndHttp2 && _isWindowsVersionIncompatibleWithHttp2)
512
return
HttpProtocols
.Http1;
TlsHandshakeCallbackOptions.cs (1)
44
internal
HttpProtocols
HttpProtocols { get; set; }
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (55)
KestrelServerOptionsTests.cs (8)
35
opt.Protocols =
HttpProtocols
.Http1;
41
Assert.Equal(
HttpProtocols
.Http1, opt.Protocols);
43
Assert.Equal(
HttpProtocols
.Http1, options.CodeBackedListenOptions[1].Protocols);
47
Assert.Equal(
HttpProtocols
.Http1, opt.Protocols);
48
opt.Protocols =
HttpProtocols
.Http2; // Can be overriden
50
Assert.Equal(
HttpProtocols
.Http2, options.CodeBackedListenOptions[2].Protocols);
54
opt.Protocols =
HttpProtocols
.Http2;
56
Assert.Equal(
HttpProtocols
.Http2, options.CodeBackedListenOptions[3].Protocols);
KestrelServerTests.cs (17)
159
[InlineData(
HttpProtocols
.Http1)]
160
[InlineData(
HttpProtocols
.Http2)]
161
public void NoTlsLogging_None(
HttpProtocols
? protocols)
169
[InlineData(
HttpProtocols
.Http1 |
HttpProtocols
.Http3)]
170
public void NoTlsLogging_Info(
HttpProtocols
? protocols)
178
[InlineData(
HttpProtocols
.Http1AndHttp2)]
179
public void NoTlsLogging_Warn(
HttpProtocols
? protocols)
187
[InlineData(
HttpProtocols
.Http1AndHttp2AndHttp3)]
188
public void NoTlsLogging_WarnAndInfo(
HttpProtocols
? protocols)
195
private static (IEnumerable<TestApplicationErrorLogger.LogMessage> warnings, IEnumerable<TestApplicationErrorLogger.LogMessage> infos) GetNoTlsLogging(
HttpProtocols
? protocols)
381
c.Protocols =
HttpProtocols
.Http3;
403
c.Protocols =
HttpProtocols
.Http3;
429
options.Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3;
456
options.Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3;
487
options.Protocols =
HttpProtocols
.Http1AndHttp2;
515
options.Protocols =
HttpProtocols
.Http3;
ListenOptionsTests.cs (1)
60
localhostListenOptions.Protocols =
HttpProtocols
.Http1;
SniOptionsSelectorTests.cs (25)
69
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
126
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
172
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
221
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
284
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
329
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
342
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
377
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
403
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
440
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
483
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
519
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
542
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
570
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
586
Protocols =
HttpProtocols
.None,
597
fallbackHttpProtocols:
HttpProtocols
.Http1,
605
Assert.Equal(
HttpProtocols
.None, httpProtocolsFeature.HttpProtocols);
619
Protocols =
HttpProtocols
.Http1,
630
fallbackHttpProtocols:
HttpProtocols
.None,
660
fallbackHttpProtocols:
HttpProtocols
.Http1,
668
Assert.Equal(
HttpProtocols
.Http1, httpProtocolsFeature.HttpProtocols);
696
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
727
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
757
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
792
fallbackHttpProtocols:
HttpProtocols
.Http1AndHttp2,
src\Servers\Kestrel\shared\test\TestContextFactory.cs (4)
61
HttpProtocols
.Http1,
91
HttpProtocols
.Http3,
156
protocols:
HttpProtocols
.Http2,
206
protocols:
HttpProtocols
.Http3,
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (5)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
237
HttpProtocols
.Http3,
src\Servers\Kestrel\shared\test\TestContextFactory.cs (4)
61
HttpProtocols
.Http1,
91
HttpProtocols
.Http3,
156
protocols:
HttpProtocols
.Http2,
206
protocols:
HttpProtocols
.Http3,
Microsoft.AspNetCore.Server.Kestrel.Tests (29)
ConfigurationReaderTests.cs (1)
332
Assert.Equal(
HttpProtocols
.Http1, config.Protocols);
KestrelConfigurationLoaderTests.cs (28)
158
opt.Protocols =
HttpProtocols
.Http1;
183
Assert.Equal(
HttpProtocols
.Http1, opt.ListenOptions.Protocols);
188
Assert.Equal(
HttpProtocols
.Http1, opt.Protocols);
808
new KeyValuePair<string, string>("Endpoints:End1:Sni:Protocols",
HttpProtocols
.Http1.ToString()),
1018
[InlineData("http1",
HttpProtocols
.Http1)]
1020
[InlineData("http1AndHttp2",
HttpProtocols
.Http1AndHttp2)] // Gracefully falls back to HTTP/1
1023
public void DefaultConfigSectionCanSetProtocols_MacAndWin7(string input,
HttpProtocols
expected)
1027
[InlineData("http1",
HttpProtocols
.Http1)]
1028
[InlineData("http2",
HttpProtocols
.Http2)]
1029
[InlineData("http1AndHttp2",
HttpProtocols
.Http1AndHttp2)]
1032
public void DefaultConfigSectionCanSetProtocols_NonWin7(string input,
HttpProtocols
expected)
1036
[InlineData("http1",
HttpProtocols
.Http1)]
1037
[InlineData("http2",
HttpProtocols
.Http2)]
1038
[InlineData("http1AndHttp2",
HttpProtocols
.Http1AndHttp2)]
1039
[InlineData("http1AndHttp2andHttp3",
HttpProtocols
.Http1AndHttp2AndHttp3)]
1042
public void DefaultConfigSectionCanSetProtocols_NonMacAndWin7(string input,
HttpProtocols
expected)
1045
private void DefaultConfigSectionCanSetProtocols(string input,
HttpProtocols
expected)
1097
[InlineData("http1",
HttpProtocols
.Http1)]
1099
[InlineData("http1AndHttp2",
HttpProtocols
.Http1AndHttp2)] // Gracefully falls back to HTTP/1
1102
public void EndpointConfigSectionCanSetProtocols_MacAndWin7(string input,
HttpProtocols
expected) =>
1106
[InlineData("http1",
HttpProtocols
.Http1)]
1107
[InlineData("http2",
HttpProtocols
.Http2)]
1108
[InlineData("http1AndHttp2",
HttpProtocols
.Http1AndHttp2)]
1111
public void EndpointConfigSectionCanSetProtocols_NonMacAndWin7(string input,
HttpProtocols
expected) =>
1114
private void EndpointConfigSectionCanSetProtocols(string input,
HttpProtocols
expected)
1359
new KeyValuePair<string, string>("Endpoints:End1:Sni:*.example.org:Protocols",
HttpProtocols
.None.ToString()),
1371
Assert.Equal(
HttpProtocols
.None, sniConfig.Protocols);
1534
Assert.Equal(
HttpProtocols
.Http1, startEndpoint.Protocols);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (8)
WebHostTests.cs (8)
56
listenOptions.Protocols = Core.
HttpProtocols
.Http3;
111
listenOptions.Protocols = Core.
HttpProtocols
.Http3;
116
listenOptions.Protocols = Core.
HttpProtocols
.Http1;
151
listenOptions.Protocols = Core.
HttpProtocols
.Http1AndHttp2AndHttp3;
188
listenOptions.Protocols = Core.
HttpProtocols
.Http1AndHttp2AndHttp3;
226
listenOptions.Protocols = Core.
HttpProtocols
.Http1AndHttp2AndHttp3;
297
listenOptions.Protocols = Core.
HttpProtocols
.Http1AndHttp2AndHttp3;
392
listenOptions.Protocols = Core.
HttpProtocols
.Http3;
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (8)
HubConnectionTests.cs (8)
1750
o2.Protocols = Server.Kestrel.Core.
HttpProtocols
.Http2;
1808
o2.Protocols = Server.Kestrel.Core.
HttpProtocols
.Http1;
1868
o2.Protocols = Server.Kestrel.Core.
HttpProtocols
.Http1AndHttp2;
1911
o2.Protocols = Server.Kestrel.Core.
HttpProtocols
.Http2;
2368
o2.Protocols = Server.Kestrel.Core.
HttpProtocols
.Http1AndHttp2;
2421
o2.Protocols = Server.Kestrel.Core.
HttpProtocols
.Http2;
2464
o2.Protocols = Server.Kestrel.Core.
HttpProtocols
.Http1AndHttp2;
2514
o2.Protocols = Server.Kestrel.Core.
HttpProtocols
.Http2;
Sockets.BindTests (4)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (4)
892
[InlineData("http1",
HttpProtocols
.Http1)]
893
[InlineData("http2",
HttpProtocols
.Http2)]
894
[InlineData("http1AndHttp2",
HttpProtocols
.Http1AndHttp2)]
895
public async Task EndpointDefaultsConfig_CanSetProtocolForUrlsConfig(string input,
HttpProtocols
expected)
Sockets.FunctionalTests (6)
src\Servers\Kestrel\test\FunctionalTests\Http2\HandshakeTests.cs (3)
56
listenOptions.Protocols =
HttpProtocols
.Http2;
82
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2;
110
listenOptions.Protocols =
HttpProtocols
.Http2;
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (3)
80
listenOptions.Protocols =
HttpProtocols
.Http2;
137
listenOptions.Protocols =
HttpProtocols
.Http2;
188
listenOptions.Protocols =
HttpProtocols
.Http2;
WebTransportInteractiveSampleApp (2)
Program.cs (2)
28
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2;
35
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3;
WebTransportSampleApp (1)
Program.cs (1)
19
listenOptions.Protocols =
HttpProtocols
.Http1AndHttp2AndHttp3;