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