From 82d2b4f4d06d79d223b3f80676b8997857bac5fc Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 13 Jun 2019 15:42:45 -0700 Subject: [PATCH] Fail on startup for Http/2 HTTPS on Mac #11061 (#11120) * Use automatic resx #11054 --- src/ProjectTemplates/test/GrpcTemplateTest.cs | 35 +- src/Servers/Kestrel/Core/src/CoreStrings.resx | 3 + .../src/Internal/HttpsConnectionAdapter.cs | 9 +- .../src/Properties/CoreStrings.Designer.cs | 2302 ----------------- src/Servers/Kestrel/Directory.Build.props | 2 + .../test/KestrelConfigurationBuilderTests.cs | 39 +- .../src/Properties/SocketsStrings.Designer.cs | 58 - .../FunctionalTests/Http2/HandshakeTests.cs | 30 +- 8 files changed, 101 insertions(+), 2377 deletions(-) delete mode 100644 src/Servers/Kestrel/Core/src/Properties/CoreStrings.Designer.cs delete mode 100644 src/Servers/Kestrel/Transport.Sockets/src/Properties/SocketsStrings.Designer.cs diff --git a/src/ProjectTemplates/test/GrpcTemplateTest.cs b/src/ProjectTemplates/test/GrpcTemplateTest.cs index 82f4fc92e9..358c048004 100644 --- a/src/ProjectTemplates/test/GrpcTemplateTest.cs +++ b/src/ProjectTemplates/test/GrpcTemplateTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Runtime.InteropServices; using System.Threading.Tasks; using Templates.Test.Helpers; using Xunit; @@ -37,16 +38,38 @@ namespace Templates.Test using (var serverProcess = Project.StartBuiltProjectAsync()) { - Assert.False( - serverProcess.Process.HasExited, - ErrorMessages.GetFailedProcessMessageOrEmpty("Run built service", Project, serverProcess.Process)); + // These templates are HTTPS + HTTP/2 only which is not supported on Mac due to missing ALPN support. + // https://github.com/aspnet/AspNetCore/issues/11061 + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + Assert.True(serverProcess.Process.HasExited, "built"); + Assert.Contains("System.NotSupportedException: HTTP/2 over TLS is not supported on OSX due to missing ALPN support.", + ErrorMessages.GetFailedProcessMessageOrEmpty("Run built service", Project, serverProcess.Process)); + } + else + { + Assert.False( + serverProcess.Process.HasExited, + ErrorMessages.GetFailedProcessMessageOrEmpty("Run built service", Project, serverProcess.Process)); + } } using (var aspNetProcess = Project.StartPublishedProjectAsync()) { - Assert.False( - aspNetProcess.Process.HasExited, - ErrorMessages.GetFailedProcessMessageOrEmpty("Run published service", Project, aspNetProcess.Process)); + // These templates are HTTPS + HTTP/2 only which is not supported on Mac due to missing ALPN support. + // https://github.com/aspnet/AspNetCore/issues/11061 + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + Assert.True(aspNetProcess.Process.HasExited, "published"); + Assert.Contains("System.NotSupportedException: HTTP/2 over TLS is not supported on OSX due to missing ALPN support.", + ErrorMessages.GetFailedProcessMessageOrEmpty("Run published service", Project, aspNetProcess.Process)); + } + else + { + Assert.False( + aspNetProcess.Process.HasExited, + ErrorMessages.GetFailedProcessMessageOrEmpty("Run published service", Project, aspNetProcess.Process)); + } } } } diff --git a/src/Servers/Kestrel/Core/src/CoreStrings.resx b/src/Servers/Kestrel/Core/src/CoreStrings.resx index 7ae053cb15..e176d8c451 100644 --- a/src/Servers/Kestrel/Core/src/CoreStrings.resx +++ b/src/Servers/Kestrel/Core/src/CoreStrings.resx @@ -605,4 +605,7 @@ For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?l The request trailers are not available yet. They may not be available until the full request body is read. + + HTTP/2 over TLS is not supported on OSX due to missing ALPN support. + \ No newline at end of file diff --git a/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs b/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs index 4f42d53c5d..3986380e60 100644 --- a/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs +++ b/src/Servers/Kestrel/Core/src/Internal/HttpsConnectionAdapter.cs @@ -5,17 +5,18 @@ using System; using System.Collections.Generic; using System.IO; using System.Net.Security; +using System.Runtime.InteropServices; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Connections.Features; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal; using Microsoft.AspNetCore.Server.Kestrel.Core.Features; using Microsoft.Extensions.Logging; -using Microsoft.AspNetCore.Http.Features; namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal { @@ -41,6 +42,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal throw new ArgumentNullException(nameof(options)); } + // This configuration will always fail per-request, preemptively fail it here. See HttpConnection.SelectProtocol(). + if (options.HttpProtocols == HttpProtocols.Http2 && RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + throw new NotSupportedException(CoreStrings.HTTP2NoTlsOsx); + } + // capture the certificate now so it can't be switched after validation _serverCertificate = options.ServerCertificate; _serverCertificateSelector = options.ServerCertificateSelector; diff --git a/src/Servers/Kestrel/Core/src/Properties/CoreStrings.Designer.cs b/src/Servers/Kestrel/Core/src/Properties/CoreStrings.Designer.cs deleted file mode 100644 index 80f4cdecd6..0000000000 --- a/src/Servers/Kestrel/Core/src/Properties/CoreStrings.Designer.cs +++ /dev/null @@ -1,2302 +0,0 @@ -// -namespace Microsoft.AspNetCore.Server.Kestrel.Core -{ - using System.Globalization; - using System.Reflection; - using System.Resources; - - internal static class CoreStrings - { - private static readonly ResourceManager _resourceManager - = new ResourceManager("Microsoft.AspNetCore.Server.Kestrel.Core.CoreStrings", typeof(CoreStrings).GetTypeInfo().Assembly); - - /// - /// Bad request. - /// - internal static string BadRequest - { - get => GetString("BadRequest"); - } - - /// - /// Bad request. - /// - internal static string FormatBadRequest() - => GetString("BadRequest"); - - /// - /// Bad chunk size data. - /// - internal static string BadRequest_BadChunkSizeData - { - get => GetString("BadRequest_BadChunkSizeData"); - } - - /// - /// Bad chunk size data. - /// - internal static string FormatBadRequest_BadChunkSizeData() - => GetString("BadRequest_BadChunkSizeData"); - - /// - /// Bad chunk suffix. - /// - internal static string BadRequest_BadChunkSuffix - { - get => GetString("BadRequest_BadChunkSuffix"); - } - - /// - /// Bad chunk suffix. - /// - internal static string FormatBadRequest_BadChunkSuffix() - => GetString("BadRequest_BadChunkSuffix"); - - /// - /// Chunked request incomplete. - /// - internal static string BadRequest_ChunkedRequestIncomplete - { - get => GetString("BadRequest_ChunkedRequestIncomplete"); - } - - /// - /// Chunked request incomplete. - /// - internal static string FormatBadRequest_ChunkedRequestIncomplete() - => GetString("BadRequest_ChunkedRequestIncomplete"); - - /// - /// The message body length cannot be determined because the final transfer coding was set to '{detail}' instead of 'chunked'. - /// - internal static string BadRequest_FinalTransferCodingNotChunked - { - get => GetString("BadRequest_FinalTransferCodingNotChunked"); - } - - /// - /// The message body length cannot be determined because the final transfer coding was set to '{detail}' instead of 'chunked'. - /// - internal static string FormatBadRequest_FinalTransferCodingNotChunked(object detail) - => string.Format(CultureInfo.CurrentCulture, GetString("BadRequest_FinalTransferCodingNotChunked", "detail"), detail); - - /// - /// Request headers too long. - /// - internal static string BadRequest_HeadersExceedMaxTotalSize - { - get => GetString("BadRequest_HeadersExceedMaxTotalSize"); - } - - /// - /// Request headers too long. - /// - internal static string FormatBadRequest_HeadersExceedMaxTotalSize() - => GetString("BadRequest_HeadersExceedMaxTotalSize"); - - /// - /// Invalid characters in header name. - /// - internal static string BadRequest_InvalidCharactersInHeaderName - { - get => GetString("BadRequest_InvalidCharactersInHeaderName"); - } - - /// - /// Invalid characters in header name. - /// - internal static string FormatBadRequest_InvalidCharactersInHeaderName() - => GetString("BadRequest_InvalidCharactersInHeaderName"); - - /// - /// Invalid content length: {detail} - /// - internal static string BadRequest_InvalidContentLength_Detail - { - get => GetString("BadRequest_InvalidContentLength_Detail"); - } - - /// - /// Invalid content length: {detail} - /// - internal static string FormatBadRequest_InvalidContentLength_Detail(object detail) - => string.Format(CultureInfo.CurrentCulture, GetString("BadRequest_InvalidContentLength_Detail", "detail"), detail); - - /// - /// Invalid Host header. - /// - internal static string BadRequest_InvalidHostHeader - { - get => GetString("BadRequest_InvalidHostHeader"); - } - - /// - /// Invalid Host header. - /// - internal static string FormatBadRequest_InvalidHostHeader() - => GetString("BadRequest_InvalidHostHeader"); - - /// - /// Invalid Host header: '{detail}' - /// - internal static string BadRequest_InvalidHostHeader_Detail - { - get => GetString("BadRequest_InvalidHostHeader_Detail"); - } - - /// - /// Invalid Host header: '{detail}' - /// - internal static string FormatBadRequest_InvalidHostHeader_Detail(object detail) - => string.Format(CultureInfo.CurrentCulture, GetString("BadRequest_InvalidHostHeader_Detail", "detail"), detail); - - /// - /// Invalid request headers: missing final CRLF in header fields. - /// - internal static string BadRequest_InvalidRequestHeadersNoCRLF - { - get => GetString("BadRequest_InvalidRequestHeadersNoCRLF"); - } - - /// - /// Invalid request headers: missing final CRLF in header fields. - /// - internal static string FormatBadRequest_InvalidRequestHeadersNoCRLF() - => GetString("BadRequest_InvalidRequestHeadersNoCRLF"); - - /// - /// Invalid request header: '{detail}' - /// - internal static string BadRequest_InvalidRequestHeader_Detail - { - get => GetString("BadRequest_InvalidRequestHeader_Detail"); - } - - /// - /// Invalid request header: '{detail}' - /// - internal static string FormatBadRequest_InvalidRequestHeader_Detail(object detail) - => string.Format(CultureInfo.CurrentCulture, GetString("BadRequest_InvalidRequestHeader_Detail", "detail"), detail); - - /// - /// Invalid request line. - /// - internal static string BadRequest_InvalidRequestLine - { - get => GetString("BadRequest_InvalidRequestLine"); - } - - /// - /// Invalid request line. - /// - internal static string FormatBadRequest_InvalidRequestLine() - => GetString("BadRequest_InvalidRequestLine"); - - /// - /// Invalid request line: '{detail}' - /// - internal static string BadRequest_InvalidRequestLine_Detail - { - get => GetString("BadRequest_InvalidRequestLine_Detail"); - } - - /// - /// Invalid request line: '{detail}' - /// - internal static string FormatBadRequest_InvalidRequestLine_Detail(object detail) - => string.Format(CultureInfo.CurrentCulture, GetString("BadRequest_InvalidRequestLine_Detail", "detail"), detail); - - /// - /// Invalid request target: '{detail}' - /// - internal static string BadRequest_InvalidRequestTarget_Detail - { - get => GetString("BadRequest_InvalidRequestTarget_Detail"); - } - - /// - /// Invalid request target: '{detail}' - /// - internal static string FormatBadRequest_InvalidRequestTarget_Detail(object detail) - => string.Format(CultureInfo.CurrentCulture, GetString("BadRequest_InvalidRequestTarget_Detail", "detail"), detail); - - /// - /// {detail} request contains no Content-Length or Transfer-Encoding header. - /// - internal static string BadRequest_LengthRequired - { - get => GetString("BadRequest_LengthRequired"); - } - - /// - /// {detail} request contains no Content-Length or Transfer-Encoding header. - /// - internal static string FormatBadRequest_LengthRequired(object detail) - => string.Format(CultureInfo.CurrentCulture, GetString("BadRequest_LengthRequired", "detail"), detail); - - /// - /// {detail} request contains no Content-Length header. - /// - internal static string BadRequest_LengthRequiredHttp10 - { - get => GetString("BadRequest_LengthRequiredHttp10"); - } - - /// - /// {detail} request contains no Content-Length header. - /// - internal static string FormatBadRequest_LengthRequiredHttp10(object detail) - => string.Format(CultureInfo.CurrentCulture, GetString("BadRequest_LengthRequiredHttp10", "detail"), detail); - - /// - /// Malformed request: invalid headers. - /// - internal static string BadRequest_MalformedRequestInvalidHeaders - { - get => GetString("BadRequest_MalformedRequestInvalidHeaders"); - } - - /// - /// Malformed request: invalid headers. - /// - internal static string FormatBadRequest_MalformedRequestInvalidHeaders() - => GetString("BadRequest_MalformedRequestInvalidHeaders"); - - /// - /// Method not allowed. - /// - internal static string BadRequest_MethodNotAllowed - { - get => GetString("BadRequest_MethodNotAllowed"); - } - - /// - /// Method not allowed. - /// - internal static string FormatBadRequest_MethodNotAllowed() - => GetString("BadRequest_MethodNotAllowed"); - - /// - /// Request is missing Host header. - /// - internal static string BadRequest_MissingHostHeader - { - get => GetString("BadRequest_MissingHostHeader"); - } - - /// - /// Request is missing Host header. - /// - internal static string FormatBadRequest_MissingHostHeader() - => GetString("BadRequest_MissingHostHeader"); - - /// - /// Multiple Content-Length headers. - /// - internal static string BadRequest_MultipleContentLengths - { - get => GetString("BadRequest_MultipleContentLengths"); - } - - /// - /// Multiple Content-Length headers. - /// - internal static string FormatBadRequest_MultipleContentLengths() - => GetString("BadRequest_MultipleContentLengths"); - - /// - /// Multiple Host headers. - /// - internal static string BadRequest_MultipleHostHeaders - { - get => GetString("BadRequest_MultipleHostHeaders"); - } - - /// - /// Multiple Host headers. - /// - internal static string FormatBadRequest_MultipleHostHeaders() - => GetString("BadRequest_MultipleHostHeaders"); - - /// - /// Request line too long. - /// - internal static string BadRequest_RequestLineTooLong - { - get => GetString("BadRequest_RequestLineTooLong"); - } - - /// - /// Request line too long. - /// - internal static string FormatBadRequest_RequestLineTooLong() - => GetString("BadRequest_RequestLineTooLong"); - - /// - /// Reading the request headers timed out. - /// - internal static string BadRequest_RequestHeadersTimeout - { - get => GetString("BadRequest_RequestHeadersTimeout"); - } - - /// - /// Reading the request headers timed out. - /// - internal static string FormatBadRequest_RequestHeadersTimeout() - => GetString("BadRequest_RequestHeadersTimeout"); - - /// - /// Request contains too many headers. - /// - internal static string BadRequest_TooManyHeaders - { - get => GetString("BadRequest_TooManyHeaders"); - } - - /// - /// Request contains too many headers. - /// - internal static string FormatBadRequest_TooManyHeaders() - => GetString("BadRequest_TooManyHeaders"); - - /// - /// Unexpected end of request content. - /// - internal static string BadRequest_UnexpectedEndOfRequestContent - { - get => GetString("BadRequest_UnexpectedEndOfRequestContent"); - } - - /// - /// Unexpected end of request content. - /// - internal static string FormatBadRequest_UnexpectedEndOfRequestContent() - => GetString("BadRequest_UnexpectedEndOfRequestContent"); - - /// - /// Unrecognized HTTP version: '{detail}' - /// - internal static string BadRequest_UnrecognizedHTTPVersion - { - get => GetString("BadRequest_UnrecognizedHTTPVersion"); - } - - /// - /// Unrecognized HTTP version: '{detail}' - /// - internal static string FormatBadRequest_UnrecognizedHTTPVersion(object detail) - => string.Format(CultureInfo.CurrentCulture, GetString("BadRequest_UnrecognizedHTTPVersion", "detail"), detail); - - /// - /// Requests with 'Connection: Upgrade' cannot have content in the request body. - /// - internal static string BadRequest_UpgradeRequestCannotHavePayload - { - get => GetString("BadRequest_UpgradeRequestCannotHavePayload"); - } - - /// - /// Requests with 'Connection: Upgrade' cannot have content in the request body. - /// - internal static string FormatBadRequest_UpgradeRequestCannotHavePayload() - => GetString("BadRequest_UpgradeRequestCannotHavePayload"); - - /// - /// Failed to bind to http://[::]:{port} (IPv6Any). Attempting to bind to http://0.0.0.0:{port} instead. - /// - internal static string FallbackToIPv4Any - { - get => GetString("FallbackToIPv4Any"); - } - - /// - /// Failed to bind to http://[::]:{port} (IPv6Any). Attempting to bind to http://0.0.0.0:{port} instead. - /// - internal static string FormatFallbackToIPv4Any(object port) - => string.Format(CultureInfo.CurrentCulture, GetString("FallbackToIPv4Any", "port"), port); - - /// - /// Cannot write to response body after connection has been upgraded. - /// - internal static string ResponseStreamWasUpgraded - { - get => GetString("ResponseStreamWasUpgraded"); - } - - /// - /// Cannot write to response body after connection has been upgraded. - /// - internal static string FormatResponseStreamWasUpgraded() - => GetString("ResponseStreamWasUpgraded"); - - /// - /// Kestrel does not support big-endian architectures. - /// - internal static string BigEndianNotSupported - { - get => GetString("BigEndianNotSupported"); - } - - /// - /// Kestrel does not support big-endian architectures. - /// - internal static string FormatBigEndianNotSupported() - => GetString("BigEndianNotSupported"); - - /// - /// Maximum request buffer size ({requestBufferSize}) must be greater than or equal to maximum request header size ({requestHeaderSize}). - /// - internal static string MaxRequestBufferSmallerThanRequestHeaderBuffer - { - get => GetString("MaxRequestBufferSmallerThanRequestHeaderBuffer"); - } - - /// - /// Maximum request buffer size ({requestBufferSize}) must be greater than or equal to maximum request header size ({requestHeaderSize}). - /// - internal static string FormatMaxRequestBufferSmallerThanRequestHeaderBuffer(object requestBufferSize, object requestHeaderSize) - => string.Format(CultureInfo.CurrentCulture, GetString("MaxRequestBufferSmallerThanRequestHeaderBuffer", "requestBufferSize", "requestHeaderSize"), requestBufferSize, requestHeaderSize); - - /// - /// Maximum request buffer size ({requestBufferSize}) must be greater than or equal to maximum request line size ({requestLineSize}). - /// - internal static string MaxRequestBufferSmallerThanRequestLineBuffer - { - get => GetString("MaxRequestBufferSmallerThanRequestLineBuffer"); - } - - /// - /// Maximum request buffer size ({requestBufferSize}) must be greater than or equal to maximum request line size ({requestLineSize}). - /// - internal static string FormatMaxRequestBufferSmallerThanRequestLineBuffer(object requestBufferSize, object requestLineSize) - => string.Format(CultureInfo.CurrentCulture, GetString("MaxRequestBufferSmallerThanRequestLineBuffer", "requestBufferSize", "requestLineSize"), requestBufferSize, requestLineSize); - - /// - /// Server has already started. - /// - internal static string ServerAlreadyStarted - { - get => GetString("ServerAlreadyStarted"); - } - - /// - /// Server has already started. - /// - internal static string FormatServerAlreadyStarted() - => GetString("ServerAlreadyStarted"); - - /// - /// Unknown transport mode: '{mode}'. - /// - internal static string UnknownTransportMode - { - get => GetString("UnknownTransportMode"); - } - - /// - /// Unknown transport mode: '{mode}'. - /// - internal static string FormatUnknownTransportMode(object mode) - => string.Format(CultureInfo.CurrentCulture, GetString("UnknownTransportMode", "mode"), mode); - - /// - /// Invalid non-ASCII or control character in header: {character} - /// - internal static string InvalidAsciiOrControlChar - { - get => GetString("InvalidAsciiOrControlChar"); - } - - /// - /// Invalid non-ASCII or control character in header: {character} - /// - internal static string FormatInvalidAsciiOrControlChar(object character) - => string.Format(CultureInfo.CurrentCulture, GetString("InvalidAsciiOrControlChar", "character"), character); - - /// - /// Invalid Content-Length: "{value}". Value must be a positive integral number. - /// - internal static string InvalidContentLength_InvalidNumber - { - get => GetString("InvalidContentLength_InvalidNumber"); - } - - /// - /// Invalid Content-Length: "{value}". Value must be a positive integral number. - /// - internal static string FormatInvalidContentLength_InvalidNumber(object value) - => string.Format(CultureInfo.CurrentCulture, GetString("InvalidContentLength_InvalidNumber", "value"), value); - - /// - /// Value must be null or a non-negative number. - /// - internal static string NonNegativeNumberOrNullRequired - { - get => GetString("NonNegativeNumberOrNullRequired"); - } - - /// - /// Value must be null or a non-negative number. - /// - internal static string FormatNonNegativeNumberOrNullRequired() - => GetString("NonNegativeNumberOrNullRequired"); - - /// - /// Value must be a non-negative number. - /// - internal static string NonNegativeNumberRequired - { - get => GetString("NonNegativeNumberRequired"); - } - - /// - /// Value must be a non-negative number. - /// - internal static string FormatNonNegativeNumberRequired() - => GetString("NonNegativeNumberRequired"); - - /// - /// Value must be a positive number. - /// - internal static string PositiveNumberRequired - { - get => GetString("PositiveNumberRequired"); - } - - /// - /// Value must be a positive number. - /// - internal static string FormatPositiveNumberRequired() - => GetString("PositiveNumberRequired"); - - /// - /// Value must be null or a positive number. - /// - internal static string PositiveNumberOrNullRequired - { - get => GetString("PositiveNumberOrNullRequired"); - } - - /// - /// Value must be null or a positive number. - /// - internal static string FormatPositiveNumberOrNullRequired() - => GetString("PositiveNumberOrNullRequired"); - - /// - /// Unix socket path must be absolute. - /// - internal static string UnixSocketPathMustBeAbsolute - { - get => GetString("UnixSocketPathMustBeAbsolute"); - } - - /// - /// Unix socket path must be absolute. - /// - internal static string FormatUnixSocketPathMustBeAbsolute() - => GetString("UnixSocketPathMustBeAbsolute"); - - /// - /// Failed to bind to address {address}. - /// - internal static string AddressBindingFailed - { - get => GetString("AddressBindingFailed"); - } - - /// - /// Failed to bind to address {address}. - /// - internal static string FormatAddressBindingFailed(object address) - => string.Format(CultureInfo.CurrentCulture, GetString("AddressBindingFailed", "address"), address); - - /// - /// No listening endpoints were configured. Binding to {address} by default. - /// - internal static string BindingToDefaultAddress - { - get => GetString("BindingToDefaultAddress"); - } - - /// - /// No listening endpoints were configured. Binding to {address} by default. - /// - internal static string FormatBindingToDefaultAddress(object address) - => string.Format(CultureInfo.CurrentCulture, GetString("BindingToDefaultAddress", "address"), address); - - /// - /// HTTPS endpoints can only be configured using {methodName}. - /// - internal static string ConfigureHttpsFromMethodCall - { - get => GetString("ConfigureHttpsFromMethodCall"); - } - - /// - /// HTTPS endpoints can only be configured using {methodName}. - /// - internal static string FormatConfigureHttpsFromMethodCall(object methodName) - => string.Format(CultureInfo.CurrentCulture, GetString("ConfigureHttpsFromMethodCall", "methodName"), methodName); - - /// - /// A path base can only be configured using {methodName}. - /// - internal static string ConfigurePathBaseFromMethodCall - { - get => GetString("ConfigurePathBaseFromMethodCall"); - } - - /// - /// A path base can only be configured using {methodName}. - /// - internal static string FormatConfigurePathBaseFromMethodCall(object methodName) - => string.Format(CultureInfo.CurrentCulture, GetString("ConfigurePathBaseFromMethodCall", "methodName"), methodName); - - /// - /// Dynamic port binding is not supported when binding to localhost. You must either bind to 127.0.0.1:0 or [::1]:0, or both. - /// - internal static string DynamicPortOnLocalhostNotSupported - { - get => GetString("DynamicPortOnLocalhostNotSupported"); - } - - /// - /// Dynamic port binding is not supported when binding to localhost. You must either bind to 127.0.0.1:0 or [::1]:0, or both. - /// - internal static string FormatDynamicPortOnLocalhostNotSupported() - => GetString("DynamicPortOnLocalhostNotSupported"); - - /// - /// Failed to bind to address {endpoint}: address already in use. - /// - internal static string EndpointAlreadyInUse - { - get => GetString("EndpointAlreadyInUse"); - } - - /// - /// Failed to bind to address {endpoint}: address already in use. - /// - internal static string FormatEndpointAlreadyInUse(object endpoint) - => string.Format(CultureInfo.CurrentCulture, GetString("EndpointAlreadyInUse", "endpoint"), endpoint); - - /// - /// Invalid URL: '{url}'. - /// - internal static string InvalidUrl - { - get => GetString("InvalidUrl"); - } - - /// - /// Invalid URL: '{url}'. - /// - internal static string FormatInvalidUrl(object url) - => string.Format(CultureInfo.CurrentCulture, GetString("InvalidUrl", "url"), url); - - /// - /// Unable to bind to {address} on the {interfaceName} interface: '{error}'. - /// - internal static string NetworkInterfaceBindingFailed - { - get => GetString("NetworkInterfaceBindingFailed"); - } - - /// - /// Unable to bind to {address} on the {interfaceName} interface: '{error}'. - /// - internal static string FormatNetworkInterfaceBindingFailed(object address, object interfaceName, object error) - => string.Format(CultureInfo.CurrentCulture, GetString("NetworkInterfaceBindingFailed", "address", "interfaceName", "error"), address, interfaceName, error); - - /// - /// Overriding address(es) '{addresses}'. Binding to endpoints defined in {methodName} instead. - /// - internal static string OverridingWithKestrelOptions - { - get => GetString("OverridingWithKestrelOptions"); - } - - /// - /// Overriding address(es) '{addresses}'. Binding to endpoints defined in {methodName} instead. - /// - internal static string FormatOverridingWithKestrelOptions(object addresses, object methodName) - => string.Format(CultureInfo.CurrentCulture, GetString("OverridingWithKestrelOptions", "addresses", "methodName"), addresses, methodName); - - /// - /// Overriding endpoints defined in UseKestrel() because {settingName} is set to true. Binding to address(es) '{addresses}' instead. - /// - internal static string OverridingWithPreferHostingUrls - { - get => GetString("OverridingWithPreferHostingUrls"); - } - - /// - /// Overriding endpoints defined in UseKestrel() because {settingName} is set to true. Binding to address(es) '{addresses}' instead. - /// - internal static string FormatOverridingWithPreferHostingUrls(object settingName, object addresses) - => string.Format(CultureInfo.CurrentCulture, GetString("OverridingWithPreferHostingUrls", "settingName", "addresses"), settingName, addresses); - - /// - /// Unrecognized scheme in server address '{address}'. Only 'http://' is supported. - /// - internal static string UnsupportedAddressScheme - { - get => GetString("UnsupportedAddressScheme"); - } - - /// - /// Unrecognized scheme in server address '{address}'. Only 'http://' is supported. - /// - internal static string FormatUnsupportedAddressScheme(object address) - => string.Format(CultureInfo.CurrentCulture, GetString("UnsupportedAddressScheme", "address"), address); - - /// - /// Headers are read-only, response has already started. - /// - internal static string HeadersAreReadOnly - { - get => GetString("HeadersAreReadOnly"); - } - - /// - /// Headers are read-only, response has already started. - /// - internal static string FormatHeadersAreReadOnly() - => GetString("HeadersAreReadOnly"); - - /// - /// An item with the same key has already been added. - /// - internal static string KeyAlreadyExists - { - get => GetString("KeyAlreadyExists"); - } - - /// - /// An item with the same key has already been added. - /// - internal static string FormatKeyAlreadyExists() - => GetString("KeyAlreadyExists"); - - /// - /// Setting the header {name} is not allowed on responses with status code {statusCode}. - /// - internal static string HeaderNotAllowedOnResponse - { - get => GetString("HeaderNotAllowedOnResponse"); - } - - /// - /// Setting the header {name} is not allowed on responses with status code {statusCode}. - /// - internal static string FormatHeaderNotAllowedOnResponse(object name, object statusCode) - => string.Format(CultureInfo.CurrentCulture, GetString("HeaderNotAllowedOnResponse", "name", "statusCode"), name, statusCode); - - /// - /// {name} cannot be set because the response has already started. - /// - internal static string ParameterReadOnlyAfterResponseStarted - { - get => GetString("ParameterReadOnlyAfterResponseStarted"); - } - - /// - /// {name} cannot be set because the response has already started. - /// - internal static string FormatParameterReadOnlyAfterResponseStarted(object name) - => string.Format(CultureInfo.CurrentCulture, GetString("ParameterReadOnlyAfterResponseStarted", "name"), name); - - /// - /// Request processing didn't complete within the shutdown timeout. - /// - internal static string RequestProcessingAborted - { - get => GetString("RequestProcessingAborted"); - } - - /// - /// Request processing didn't complete within the shutdown timeout. - /// - internal static string FormatRequestProcessingAborted() - => GetString("RequestProcessingAborted"); - - /// - /// Response Content-Length mismatch: too few bytes written ({written} of {expected}). - /// - internal static string TooFewBytesWritten - { - get => GetString("TooFewBytesWritten"); - } - - /// - /// Response Content-Length mismatch: too few bytes written ({written} of {expected}). - /// - internal static string FormatTooFewBytesWritten(object written, object expected) - => string.Format(CultureInfo.CurrentCulture, GetString("TooFewBytesWritten", "written", "expected"), written, expected); - - /// - /// Response Content-Length mismatch: too many bytes written ({written} of {expected}). - /// - internal static string TooManyBytesWritten - { - get => GetString("TooManyBytesWritten"); - } - - /// - /// Response Content-Length mismatch: too many bytes written ({written} of {expected}). - /// - internal static string FormatTooManyBytesWritten(object written, object expected) - => string.Format(CultureInfo.CurrentCulture, GetString("TooManyBytesWritten", "written", "expected"), written, expected); - - /// - /// The response has been aborted due to an unhandled application exception. - /// - internal static string UnhandledApplicationException - { - get => GetString("UnhandledApplicationException"); - } - - /// - /// The response has been aborted due to an unhandled application exception. - /// - internal static string FormatUnhandledApplicationException() - => GetString("UnhandledApplicationException"); - - /// - /// Writing to the response body is invalid for responses with status code {statusCode}. - /// - internal static string WritingToResponseBodyNotSupported - { - get => GetString("WritingToResponseBodyNotSupported"); - } - - /// - /// Writing to the response body is invalid for responses with status code {statusCode}. - /// - internal static string FormatWritingToResponseBodyNotSupported(object statusCode) - => string.Format(CultureInfo.CurrentCulture, GetString("WritingToResponseBodyNotSupported", "statusCode"), statusCode); - - /// - /// Connection shutdown abnormally. - /// - internal static string ConnectionShutdownError - { - get => GetString("ConnectionShutdownError"); - } - - /// - /// Connection shutdown abnormally. - /// - internal static string FormatConnectionShutdownError() - => GetString("ConnectionShutdownError"); - - /// - /// Connection processing ended abnormally. - /// - internal static string RequestProcessingEndError - { - get => GetString("RequestProcessingEndError"); - } - - /// - /// Connection processing ended abnormally. - /// - internal static string FormatRequestProcessingEndError() - => GetString("RequestProcessingEndError"); - - /// - /// Cannot upgrade a non-upgradable request. Check IHttpUpgradeFeature.IsUpgradableRequest to determine if a request can be upgraded. - /// - internal static string CannotUpgradeNonUpgradableRequest - { - get => GetString("CannotUpgradeNonUpgradableRequest"); - } - - /// - /// Cannot upgrade a non-upgradable request. Check IHttpUpgradeFeature.IsUpgradableRequest to determine if a request can be upgraded. - /// - internal static string FormatCannotUpgradeNonUpgradableRequest() - => GetString("CannotUpgradeNonUpgradableRequest"); - - /// - /// Request cannot be upgraded because the server has already opened the maximum number of upgraded connections. - /// - internal static string UpgradedConnectionLimitReached - { - get => GetString("UpgradedConnectionLimitReached"); - } - - /// - /// Request cannot be upgraded because the server has already opened the maximum number of upgraded connections. - /// - internal static string FormatUpgradedConnectionLimitReached() - => GetString("UpgradedConnectionLimitReached"); - - /// - /// IHttpUpgradeFeature.UpgradeAsync was already called and can only be called once per connection. - /// - internal static string UpgradeCannotBeCalledMultipleTimes - { - get => GetString("UpgradeCannotBeCalledMultipleTimes"); - } - - /// - /// IHttpUpgradeFeature.UpgradeAsync was already called and can only be called once per connection. - /// - internal static string FormatUpgradeCannotBeCalledMultipleTimes() - => GetString("UpgradeCannotBeCalledMultipleTimes"); - - /// - /// Request body too large. - /// - internal static string BadRequest_RequestBodyTooLarge - { - get => GetString("BadRequest_RequestBodyTooLarge"); - } - - /// - /// Request body too large. - /// - internal static string FormatBadRequest_RequestBodyTooLarge() - => GetString("BadRequest_RequestBodyTooLarge"); - - /// - /// The maximum request body size cannot be modified after the app has already started reading from the request body. - /// - internal static string MaxRequestBodySizeCannotBeModifiedAfterRead - { - get => GetString("MaxRequestBodySizeCannotBeModifiedAfterRead"); - } - - /// - /// The maximum request body size cannot be modified after the app has already started reading from the request body. - /// - internal static string FormatMaxRequestBodySizeCannotBeModifiedAfterRead() - => GetString("MaxRequestBodySizeCannotBeModifiedAfterRead"); - - /// - /// The maximum request body size cannot be modified after the request has been upgraded. - /// - internal static string MaxRequestBodySizeCannotBeModifiedForUpgradedRequests - { - get => GetString("MaxRequestBodySizeCannotBeModifiedForUpgradedRequests"); - } - - /// - /// The maximum request body size cannot be modified after the request has been upgraded. - /// - internal static string FormatMaxRequestBodySizeCannotBeModifiedForUpgradedRequests() - => GetString("MaxRequestBodySizeCannotBeModifiedForUpgradedRequests"); - - /// - /// Value must be a positive TimeSpan. - /// - internal static string PositiveTimeSpanRequired - { - get => GetString("PositiveTimeSpanRequired"); - } - - /// - /// Value must be a positive TimeSpan. - /// - internal static string FormatPositiveTimeSpanRequired() - => GetString("PositiveTimeSpanRequired"); - - /// - /// Value must be a non-negative TimeSpan. - /// - internal static string NonNegativeTimeSpanRequired - { - get => GetString("NonNegativeTimeSpanRequired"); - } - - /// - /// Value must be a non-negative TimeSpan. - /// - internal static string FormatNonNegativeTimeSpanRequired() - => GetString("NonNegativeTimeSpanRequired"); - - /// - /// The request body rate enforcement grace period must be greater than {heartbeatInterval} second. - /// - internal static string MinimumGracePeriodRequired - { - get => GetString("MinimumGracePeriodRequired"); - } - - /// - /// The request body rate enforcement grace period must be greater than {heartbeatInterval} second. - /// - internal static string FormatMinimumGracePeriodRequired(object heartbeatInterval) - => string.Format(CultureInfo.CurrentCulture, GetString("MinimumGracePeriodRequired", "heartbeatInterval"), heartbeatInterval); - - /// - /// Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead. - /// - internal static string SynchronousReadsDisallowed - { - get => GetString("SynchronousReadsDisallowed"); - } - - /// - /// Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead. - /// - internal static string FormatSynchronousReadsDisallowed() - => GetString("SynchronousReadsDisallowed"); - - /// - /// Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead. - /// - internal static string SynchronousWritesDisallowed - { - get => GetString("SynchronousWritesDisallowed"); - } - - /// - /// Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead. - /// - internal static string FormatSynchronousWritesDisallowed() - => GetString("SynchronousWritesDisallowed"); - - /// - /// Value must be a positive number. To disable a minimum data rate, use null where a MinDataRate instance is expected. - /// - internal static string PositiveNumberOrNullMinDataRateRequired - { - get => GetString("PositiveNumberOrNullMinDataRateRequired"); - } - - /// - /// Value must be a positive number. To disable a minimum data rate, use null where a MinDataRate instance is expected. - /// - internal static string FormatPositiveNumberOrNullMinDataRateRequired() - => GetString("PositiveNumberOrNullMinDataRateRequired"); - - /// - /// Concurrent timeouts are not supported. - /// - internal static string ConcurrentTimeoutsNotSupported - { - get => GetString("ConcurrentTimeoutsNotSupported"); - } - - /// - /// Concurrent timeouts are not supported. - /// - internal static string FormatConcurrentTimeoutsNotSupported() - => GetString("ConcurrentTimeoutsNotSupported"); - - /// - /// Timespan must be positive and finite. - /// - internal static string PositiveFiniteTimeSpanRequired - { - get => GetString("PositiveFiniteTimeSpanRequired"); - } - - /// - /// Timespan must be positive and finite. - /// - internal static string FormatPositiveFiniteTimeSpanRequired() - => GetString("PositiveFiniteTimeSpanRequired"); - - /// - /// An endpoint must be configured to serve at least one protocol. - /// - internal static string EndPointRequiresAtLeastOneProtocol - { - get => GetString("EndPointRequiresAtLeastOneProtocol"); - } - - /// - /// An endpoint must be configured to serve at least one protocol. - /// - internal static string FormatEndPointRequiresAtLeastOneProtocol() - => GetString("EndPointRequiresAtLeastOneProtocol"); - - /// - /// HTTP/2 over TLS was not negotiated on an HTTP/2-only endpoint. - /// - internal static string EndPointHttp2NotNegotiated - { - get => GetString("EndPointHttp2NotNegotiated"); - } - - /// - /// HTTP/2 over TLS was not negotiated on an HTTP/2-only endpoint. - /// - internal static string FormatEndPointHttp2NotNegotiated() - => GetString("EndPointHttp2NotNegotiated"); - - /// - /// A dynamic table size of {size} octets is greater than the configured maximum size of {maxSize} octets. - /// - internal static string HPackErrorDynamicTableSizeUpdateTooLarge - { - get => GetString("HPackErrorDynamicTableSizeUpdateTooLarge"); - } - - /// - /// A dynamic table size of {size} octets is greater than the configured maximum size of {maxSize} octets. - /// - internal static string FormatHPackErrorDynamicTableSizeUpdateTooLarge(object size, object maxSize) - => string.Format(CultureInfo.CurrentCulture, GetString("HPackErrorDynamicTableSizeUpdateTooLarge", "size", "maxSize"), size, maxSize); - - /// - /// Index {index} is outside the bounds of the header field table. - /// - internal static string HPackErrorIndexOutOfRange - { - get => GetString("HPackErrorIndexOutOfRange"); - } - - /// - /// Index {index} is outside the bounds of the header field table. - /// - internal static string FormatHPackErrorIndexOutOfRange(object index) - => string.Format(CultureInfo.CurrentCulture, GetString("HPackErrorIndexOutOfRange", "index"), index); - - /// - /// Input data could not be fully decoded. - /// - internal static string HPackHuffmanErrorIncomplete - { - get => GetString("HPackHuffmanErrorIncomplete"); - } - - /// - /// Input data could not be fully decoded. - /// - internal static string FormatHPackHuffmanErrorIncomplete() - => GetString("HPackHuffmanErrorIncomplete"); - - /// - /// Input data contains the EOS symbol. - /// - internal static string HPackHuffmanErrorEOS - { - get => GetString("HPackHuffmanErrorEOS"); - } - - /// - /// Input data contains the EOS symbol. - /// - internal static string FormatHPackHuffmanErrorEOS() - => GetString("HPackHuffmanErrorEOS"); - - /// - /// The destination buffer is not large enough to store the decoded data. - /// - internal static string HPackHuffmanErrorDestinationTooSmall - { - get => GetString("HPackHuffmanErrorDestinationTooSmall"); - } - - /// - /// The destination buffer is not large enough to store the decoded data. - /// - internal static string FormatHPackHuffmanErrorDestinationTooSmall() - => GetString("HPackHuffmanErrorDestinationTooSmall"); - - /// - /// Huffman decoding error. - /// - internal static string HPackHuffmanError - { - get => GetString("HPackHuffmanError"); - } - - /// - /// Huffman decoding error. - /// - internal static string FormatHPackHuffmanError() - => GetString("HPackHuffmanError"); - - /// - /// Decoded string length of {length} octets is greater than the configured maximum length of {maxStringLength} octets. - /// - internal static string HPackStringLengthTooLarge - { - get => GetString("HPackStringLengthTooLarge"); - } - - /// - /// Decoded string length of {length} octets is greater than the configured maximum length of {maxStringLength} octets. - /// - internal static string FormatHPackStringLengthTooLarge(object length, object maxStringLength) - => string.Format(CultureInfo.CurrentCulture, GetString("HPackStringLengthTooLarge", "length", "maxStringLength"), length, maxStringLength); - - /// - /// The header block was incomplete and could not be fully decoded. - /// - internal static string HPackErrorIncompleteHeaderBlock - { - get => GetString("HPackErrorIncompleteHeaderBlock"); - } - - /// - /// The header block was incomplete and could not be fully decoded. - /// - internal static string FormatHPackErrorIncompleteHeaderBlock() - => GetString("HPackErrorIncompleteHeaderBlock"); - - /// - /// The client sent a {frameType} frame with even stream ID {streamId}. - /// - internal static string Http2ErrorStreamIdEven - { - get => GetString("Http2ErrorStreamIdEven"); - } - - /// - /// The client sent a {frameType} frame with even stream ID {streamId}. - /// - internal static string FormatHttp2ErrorStreamIdEven(object frameType, object streamId) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorStreamIdEven", "frameType", "streamId"), frameType, streamId); - - /// - /// The client sent a A PUSH_PROMISE frame. - /// - internal static string Http2ErrorPushPromiseReceived - { - get => GetString("Http2ErrorPushPromiseReceived"); - } - - /// - /// The client sent a A PUSH_PROMISE frame. - /// - internal static string FormatHttp2ErrorPushPromiseReceived() - => GetString("Http2ErrorPushPromiseReceived"); - - /// - /// The client sent a {frameType} frame to stream ID {streamId} before signaling of the header block for stream ID {headersStreamId}. - /// - internal static string Http2ErrorHeadersInterleaved - { - get => GetString("Http2ErrorHeadersInterleaved"); - } - - /// - /// The client sent a {frameType} frame to stream ID {streamId} before signaling of the header block for stream ID {headersStreamId}. - /// - internal static string FormatHttp2ErrorHeadersInterleaved(object frameType, object streamId, object headersStreamId) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorHeadersInterleaved", "frameType", "streamId", "headersStreamId"), frameType, streamId, headersStreamId); - - /// - /// The client sent a {frameType} frame with stream ID 0. - /// - internal static string Http2ErrorStreamIdZero - { - get => GetString("Http2ErrorStreamIdZero"); - } - - /// - /// The client sent a {frameType} frame with stream ID 0. - /// - internal static string FormatHttp2ErrorStreamIdZero(object frameType) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorStreamIdZero", "frameType"), frameType); - - /// - /// The client sent a {frameType} frame with stream ID different than 0. - /// - internal static string Http2ErrorStreamIdNotZero - { - get => GetString("Http2ErrorStreamIdNotZero"); - } - - /// - /// The client sent a {frameType} frame with stream ID different than 0. - /// - internal static string FormatHttp2ErrorStreamIdNotZero(object frameType) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorStreamIdNotZero", "frameType"), frameType); - - /// - /// The client sent a {frameType} frame with padding longer than or with the same length as the sent data. - /// - internal static string Http2ErrorPaddingTooLong - { - get => GetString("Http2ErrorPaddingTooLong"); - } - - /// - /// The client sent a {frameType} frame with padding longer than or with the same length as the sent data. - /// - internal static string FormatHttp2ErrorPaddingTooLong(object frameType) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorPaddingTooLong", "frameType"), frameType); - - /// - /// The client sent a {frameType} frame to closed stream ID {streamId}. - /// - internal static string Http2ErrorStreamClosed - { - get => GetString("Http2ErrorStreamClosed"); - } - - /// - /// The client sent a {frameType} frame to closed stream ID {streamId}. - /// - internal static string FormatHttp2ErrorStreamClosed(object frameType, object streamId) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorStreamClosed", "frameType", "streamId"), frameType, streamId); - - /// - /// The client sent a {frameType} frame to stream ID {streamId} which is in the "half-closed (remote) state". - /// - internal static string Http2ErrorStreamHalfClosedRemote - { - get => GetString("Http2ErrorStreamHalfClosedRemote"); - } - - /// - /// The client sent a {frameType} frame to stream ID {streamId} which is in the "half-closed (remote) state". - /// - internal static string FormatHttp2ErrorStreamHalfClosedRemote(object frameType, object streamId) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorStreamHalfClosedRemote", "frameType", "streamId"), frameType, streamId); - - /// - /// The client sent a {frameType} frame with dependency information that would cause stream ID {streamId} to depend on itself. - /// - internal static string Http2ErrorStreamSelfDependency - { - get => GetString("Http2ErrorStreamSelfDependency"); - } - - /// - /// The client sent a {frameType} frame with dependency information that would cause stream ID {streamId} to depend on itself. - /// - internal static string FormatHttp2ErrorStreamSelfDependency(object frameType, object streamId) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorStreamSelfDependency", "frameType", "streamId"), frameType, streamId); - - /// - /// The client sent a {frameType} frame with length different than {expectedLength}. - /// - internal static string Http2ErrorUnexpectedFrameLength - { - get => GetString("Http2ErrorUnexpectedFrameLength"); - } - - /// - /// The client sent a {frameType} frame with length different than {expectedLength}. - /// - internal static string FormatHttp2ErrorUnexpectedFrameLength(object frameType, object expectedLength) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorUnexpectedFrameLength", "frameType", "expectedLength"), frameType, expectedLength); - - /// - /// The client sent a SETTINGS frame with a length that is not a multiple of 6. - /// - internal static string Http2ErrorSettingsLengthNotMultipleOfSix - { - get => GetString("Http2ErrorSettingsLengthNotMultipleOfSix"); - } - - /// - /// The client sent a SETTINGS frame with a length that is not a multiple of 6. - /// - internal static string FormatHttp2ErrorSettingsLengthNotMultipleOfSix() - => GetString("Http2ErrorSettingsLengthNotMultipleOfSix"); - - /// - /// The client sent a SETTINGS frame with ACK set and length different than 0. - /// - internal static string Http2ErrorSettingsAckLengthNotZero - { - get => GetString("Http2ErrorSettingsAckLengthNotZero"); - } - - /// - /// The client sent a SETTINGS frame with ACK set and length different than 0. - /// - internal static string FormatHttp2ErrorSettingsAckLengthNotZero() - => GetString("Http2ErrorSettingsAckLengthNotZero"); - - /// - /// The client sent a SETTINGS frame with a value for parameter {parameter} that is out of range. - /// - internal static string Http2ErrorSettingsParameterOutOfRange - { - get => GetString("Http2ErrorSettingsParameterOutOfRange"); - } - - /// - /// The client sent a SETTINGS frame with a value for parameter {parameter} that is out of range. - /// - internal static string FormatHttp2ErrorSettingsParameterOutOfRange(object parameter) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorSettingsParameterOutOfRange", "parameter"), parameter); - - /// - /// The client sent a WINDOW_UPDATE frame with a window size increment of 0. - /// - internal static string Http2ErrorWindowUpdateIncrementZero - { - get => GetString("Http2ErrorWindowUpdateIncrementZero"); - } - - /// - /// The client sent a WINDOW_UPDATE frame with a window size increment of 0. - /// - internal static string FormatHttp2ErrorWindowUpdateIncrementZero() - => GetString("Http2ErrorWindowUpdateIncrementZero"); - - /// - /// The client sent a CONTINUATION frame not preceded by a HEADERS frame. - /// - internal static string Http2ErrorContinuationWithNoHeaders - { - get => GetString("Http2ErrorContinuationWithNoHeaders"); - } - - /// - /// The client sent a CONTINUATION frame not preceded by a HEADERS frame. - /// - internal static string FormatHttp2ErrorContinuationWithNoHeaders() - => GetString("Http2ErrorContinuationWithNoHeaders"); - - /// - /// The client sent a {frameType} frame to idle stream ID {streamId}. - /// - internal static string Http2ErrorStreamIdle - { - get => GetString("Http2ErrorStreamIdle"); - } - - /// - /// The client sent a {frameType} frame to idle stream ID {streamId}. - /// - internal static string FormatHttp2ErrorStreamIdle(object frameType, object streamId) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorStreamIdle", "frameType", "streamId"), frameType, streamId); - - /// - /// The client sent trailers containing one or more pseudo-header fields. - /// - internal static string Http2ErrorTrailersContainPseudoHeaderField - { - get => GetString("Http2ErrorTrailersContainPseudoHeaderField"); - } - - /// - /// The client sent trailers containing one or more pseudo-header fields. - /// - internal static string FormatHttp2ErrorTrailersContainPseudoHeaderField() - => GetString("Http2ErrorTrailersContainPseudoHeaderField"); - - /// - /// The client sent a header with uppercase characters in its name. - /// - internal static string Http2ErrorHeaderNameUppercase - { - get => GetString("Http2ErrorHeaderNameUppercase"); - } - - /// - /// The client sent a header with uppercase characters in its name. - /// - internal static string FormatHttp2ErrorHeaderNameUppercase() - => GetString("Http2ErrorHeaderNameUppercase"); - - /// - /// The client sent a trailer with uppercase characters in its name. - /// - internal static string Http2ErrorTrailerNameUppercase - { - get => GetString("Http2ErrorTrailerNameUppercase"); - } - - /// - /// The client sent a trailer with uppercase characters in its name. - /// - internal static string FormatHttp2ErrorTrailerNameUppercase() - => GetString("Http2ErrorTrailerNameUppercase"); - - /// - /// The client sent a HEADERS frame containing trailers without setting the END_STREAM flag. - /// - internal static string Http2ErrorHeadersWithTrailersNoEndStream - { - get => GetString("Http2ErrorHeadersWithTrailersNoEndStream"); - } - - /// - /// The client sent a HEADERS frame containing trailers without setting the END_STREAM flag. - /// - internal static string FormatHttp2ErrorHeadersWithTrailersNoEndStream() - => GetString("Http2ErrorHeadersWithTrailersNoEndStream"); - - /// - /// Request headers missing one or more mandatory pseudo-header fields. - /// - internal static string Http2ErrorMissingMandatoryPseudoHeaderFields - { - get => GetString("Http2ErrorMissingMandatoryPseudoHeaderFields"); - } - - /// - /// Request headers missing one or more mandatory pseudo-header fields. - /// - internal static string FormatHttp2ErrorMissingMandatoryPseudoHeaderFields() - => GetString("Http2ErrorMissingMandatoryPseudoHeaderFields"); - - /// - /// Pseudo-header field found in request headers after regular header fields. - /// - internal static string Http2ErrorPseudoHeaderFieldAfterRegularHeaders - { - get => GetString("Http2ErrorPseudoHeaderFieldAfterRegularHeaders"); - } - - /// - /// Pseudo-header field found in request headers after regular header fields. - /// - internal static string FormatHttp2ErrorPseudoHeaderFieldAfterRegularHeaders() - => GetString("Http2ErrorPseudoHeaderFieldAfterRegularHeaders"); - - /// - /// Request headers contain unknown pseudo-header field. - /// - internal static string Http2ErrorUnknownPseudoHeaderField - { - get => GetString("Http2ErrorUnknownPseudoHeaderField"); - } - - /// - /// Request headers contain unknown pseudo-header field. - /// - internal static string FormatHttp2ErrorUnknownPseudoHeaderField() - => GetString("Http2ErrorUnknownPseudoHeaderField"); - - /// - /// Request headers contain response-specific pseudo-header field. - /// - internal static string Http2ErrorResponsePseudoHeaderField - { - get => GetString("Http2ErrorResponsePseudoHeaderField"); - } - - /// - /// Request headers contain response-specific pseudo-header field. - /// - internal static string FormatHttp2ErrorResponsePseudoHeaderField() - => GetString("Http2ErrorResponsePseudoHeaderField"); - - /// - /// Request headers contain duplicate pseudo-header field. - /// - internal static string Http2ErrorDuplicatePseudoHeaderField - { - get => GetString("Http2ErrorDuplicatePseudoHeaderField"); - } - - /// - /// Request headers contain duplicate pseudo-header field. - /// - internal static string FormatHttp2ErrorDuplicatePseudoHeaderField() - => GetString("Http2ErrorDuplicatePseudoHeaderField"); - - /// - /// Request headers contain connection-specific header field. - /// - internal static string Http2ErrorConnectionSpecificHeaderField - { - get => GetString("Http2ErrorConnectionSpecificHeaderField"); - } - - /// - /// Request headers contain connection-specific header field. - /// - internal static string FormatHttp2ErrorConnectionSpecificHeaderField() - => GetString("Http2ErrorConnectionSpecificHeaderField"); - - /// - /// Unable to configure default https bindings because no IDefaultHttpsProvider service was provided. - /// - internal static string UnableToConfigureHttpsBindings - { - get => GetString("UnableToConfigureHttpsBindings"); - } - - /// - /// Unable to configure default https bindings because no IDefaultHttpsProvider service was provided. - /// - internal static string FormatUnableToConfigureHttpsBindings() - => GetString("UnableToConfigureHttpsBindings"); - - /// - /// Failed to authenticate HTTPS connection. - /// - internal static string AuthenticationFailed - { - get => GetString("AuthenticationFailed"); - } - - /// - /// Failed to authenticate HTTPS connection. - /// - internal static string FormatAuthenticationFailed() - => GetString("AuthenticationFailed"); - - /// - /// Authentication of the HTTPS connection timed out. - /// - internal static string AuthenticationTimedOut - { - get => GetString("AuthenticationTimedOut"); - } - - /// - /// Authentication of the HTTPS connection timed out. - /// - internal static string FormatAuthenticationTimedOut() - => GetString("AuthenticationTimedOut"); - - /// - /// Certificate {thumbprint} cannot be used as an SSL server certificate. It has an Extended Key Usage extension but the usages do not include Server Authentication (OID 1.3.6.1.5.5.7.3.1). - /// - internal static string InvalidServerCertificateEku - { - get => GetString("InvalidServerCertificateEku"); - } - - /// - /// Certificate {thumbprint} cannot be used as an SSL server certificate. It has an Extended Key Usage extension but the usages do not include Server Authentication (OID 1.3.6.1.5.5.7.3.1). - /// - internal static string FormatInvalidServerCertificateEku(object thumbprint) - => string.Format(CultureInfo.CurrentCulture, GetString("InvalidServerCertificateEku", "thumbprint"), thumbprint); - - /// - /// Value must be a positive TimeSpan. - /// - internal static string PositiveTimeSpanRequired1 - { - get => GetString("PositiveTimeSpanRequired1"); - } - - /// - /// Value must be a positive TimeSpan. - /// - internal static string FormatPositiveTimeSpanRequired1() - => GetString("PositiveTimeSpanRequired1"); - - /// - /// The server certificate parameter is required. - /// - internal static string ServerCertificateRequired - { - get => GetString("ServerCertificateRequired"); - } - - /// - /// The server certificate parameter is required. - /// - internal static string FormatServerCertificateRequired() - => GetString("ServerCertificateRequired"); - - /// - /// No listening endpoints were configured. Binding to {address0} and {address1} by default. - /// - internal static string BindingToDefaultAddresses - { - get => GetString("BindingToDefaultAddresses"); - } - - /// - /// No listening endpoints were configured. Binding to {address0} and {address1} by default. - /// - internal static string FormatBindingToDefaultAddresses(object address0, object address1) - => string.Format(CultureInfo.CurrentCulture, GetString("BindingToDefaultAddresses", "address0", "address1"), address0, address1); - - /// - /// The requested certificate {subject} could not be found in {storeLocation}/{storeName} with AllowInvalid setting: {allowInvalid}. - /// - internal static string CertNotFoundInStore - { - get => GetString("CertNotFoundInStore"); - } - - /// - /// The requested certificate {subject} could not be found in {storeLocation}/{storeName} with AllowInvalid setting: {allowInvalid}. - /// - internal static string FormatCertNotFoundInStore(object subject, object storeLocation, object storeName, object allowInvalid) - => string.Format(CultureInfo.CurrentCulture, GetString("CertNotFoundInStore", "subject", "storeLocation", "storeName", "allowInvalid"), subject, storeLocation, storeName, allowInvalid); - - /// - /// The endpoint {endpointName} is missing the required 'Url' parameter. - /// - internal static string EndpointMissingUrl - { - get => GetString("EndpointMissingUrl"); - } - - /// - /// The endpoint {endpointName} is missing the required 'Url' parameter. - /// - internal static string FormatEndpointMissingUrl(object endpointName) - => string.Format(CultureInfo.CurrentCulture, GetString("EndpointMissingUrl", "endpointName"), endpointName); - - /// - /// Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found. - /// To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'. - /// For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. - /// - internal static string NoCertSpecifiedNoDevelopmentCertificateFound - { - get => GetString("NoCertSpecifiedNoDevelopmentCertificateFound"); - } - - /// - /// Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found. - /// To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'. - /// For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. - /// - internal static string FormatNoCertSpecifiedNoDevelopmentCertificateFound() - => GetString("NoCertSpecifiedNoDevelopmentCertificateFound"); - - /// - /// The endpoint {endpointName} specified multiple certificate sources. - /// - internal static string MultipleCertificateSources - { - get => GetString("MultipleCertificateSources"); - } - - /// - /// The endpoint {endpointName} specified multiple certificate sources. - /// - internal static string FormatMultipleCertificateSources(object endpointName) - => string.Format(CultureInfo.CurrentCulture, GetString("MultipleCertificateSources", "endpointName"), endpointName); - - /// - /// Cannot write to the response body, the response has completed. - /// - internal static string WritingToResponseBodyAfterResponseCompleted - { - get => GetString("WritingToResponseBodyAfterResponseCompleted"); - } - - /// - /// Cannot write to the response body, the response has completed. - /// - internal static string FormatWritingToResponseBodyAfterResponseCompleted() - => GetString("WritingToResponseBodyAfterResponseCompleted"); - - /// - /// Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate. - /// - internal static string BadRequest_RequestBodyTimeout - { - get => GetString("BadRequest_RequestBodyTimeout"); - } - - /// - /// Reading the request body timed out due to data arriving too slowly. See MinRequestBodyDataRate. - /// - internal static string FormatBadRequest_RequestBodyTimeout() - => GetString("BadRequest_RequestBodyTimeout"); - - /// - /// The connection was aborted by the application. - /// - internal static string ConnectionAbortedByApplication - { - get => GetString("ConnectionAbortedByApplication"); - } - - /// - /// The connection was aborted by the application. - /// - internal static string FormatConnectionAbortedByApplication() - => GetString("ConnectionAbortedByApplication"); - - /// - /// The connection was aborted because the server is shutting down and request processing didn't complete within the time specified by HostOptions.ShutdownTimeout. - /// - internal static string ConnectionAbortedDuringServerShutdown - { - get => GetString("ConnectionAbortedDuringServerShutdown"); - } - - /// - /// The connection was aborted because the server is shutting down and request processing didn't complete within the time specified by HostOptions.ShutdownTimeout. - /// - internal static string FormatConnectionAbortedDuringServerShutdown() - => GetString("ConnectionAbortedDuringServerShutdown"); - - /// - /// The connection was timed out by the server because the response was not read by the client at the specified minimum data rate. - /// - internal static string ConnectionTimedBecauseResponseMininumDataRateNotSatisfied - { - get => GetString("ConnectionTimedBecauseResponseMininumDataRateNotSatisfied"); - } - - /// - /// The connection was timed out by the server because the response was not read by the client at the specified minimum data rate. - /// - internal static string FormatConnectionTimedBecauseResponseMininumDataRateNotSatisfied() - => GetString("ConnectionTimedBecauseResponseMininumDataRateNotSatisfied"); - - /// - /// The connection was timed out by the server. - /// - internal static string ConnectionTimedOutByServer - { - get => GetString("ConnectionTimedOutByServer"); - } - - /// - /// The connection was timed out by the server. - /// - internal static string FormatConnectionTimedOutByServer() - => GetString("ConnectionTimedOutByServer"); - - /// - /// The received frame size of {size} exceeds the limit {limit}. - /// - internal static string Http2ErrorFrameOverLimit - { - get => GetString("Http2ErrorFrameOverLimit"); - } - - /// - /// The received frame size of {size} exceeds the limit {limit}. - /// - internal static string FormatHttp2ErrorFrameOverLimit(object size, object limit) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorFrameOverLimit", "size", "limit"), size, limit); - - /// - /// Tls 1.2 or later must be used for HTTP/2. {protocol} was negotiated. - /// - internal static string Http2ErrorMinTlsVersion - { - get => GetString("Http2ErrorMinTlsVersion"); - } - - /// - /// Tls 1.2 or later must be used for HTTP/2. {protocol} was negotiated. - /// - internal static string FormatHttp2ErrorMinTlsVersion(object protocol) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorMinTlsVersion", "protocol"), protocol); - - /// - /// Invalid HTTP/2 connection preface. - /// - internal static string Http2ErrorInvalidPreface - { - get => GetString("Http2ErrorInvalidPreface"); - } - - /// - /// Invalid HTTP/2 connection preface. - /// - internal static string FormatHttp2ErrorInvalidPreface() - => GetString("Http2ErrorInvalidPreface"); - - /// - /// Header name cannot be a null or empty string. - /// - internal static string InvalidEmptyHeaderName - { - get => GetString("InvalidEmptyHeaderName"); - } - - /// - /// Header name cannot be a null or empty string. - /// - internal static string FormatInvalidEmptyHeaderName() - => GetString("InvalidEmptyHeaderName"); - - /// - /// The connection or stream was aborted because a write operation was aborted with a CancellationToken. - /// - internal static string ConnectionOrStreamAbortedByCancellationToken - { - get => GetString("ConnectionOrStreamAbortedByCancellationToken"); - } - - /// - /// The connection or stream was aborted because a write operation was aborted with a CancellationToken. - /// - internal static string FormatConnectionOrStreamAbortedByCancellationToken() - => GetString("ConnectionOrStreamAbortedByCancellationToken"); - - /// - /// The client sent a SETTINGS frame with a SETTINGS_INITIAL_WINDOW_SIZE that caused a flow-control window to exceed the maximum size. - /// - internal static string Http2ErrorInitialWindowSizeInvalid - { - get => GetString("Http2ErrorInitialWindowSizeInvalid"); - } - - /// - /// The client sent a SETTINGS frame with a SETTINGS_INITIAL_WINDOW_SIZE that caused a flow-control window to exceed the maximum size. - /// - internal static string FormatHttp2ErrorInitialWindowSizeInvalid() - => GetString("Http2ErrorInitialWindowSizeInvalid"); - - /// - /// The client sent a WINDOW_UPDATE frame that caused a flow-control window to exceed the maximum size. - /// - internal static string Http2ErrorWindowUpdateSizeInvalid - { - get => GetString("Http2ErrorWindowUpdateSizeInvalid"); - } - - /// - /// The client sent a WINDOW_UPDATE frame that caused a flow-control window to exceed the maximum size. - /// - internal static string FormatHttp2ErrorWindowUpdateSizeInvalid() - => GetString("Http2ErrorWindowUpdateSizeInvalid"); - - /// - /// The HTTP/2 connection faulted. - /// - internal static string Http2ConnectionFaulted - { - get => GetString("Http2ConnectionFaulted"); - } - - /// - /// The HTTP/2 connection faulted. - /// - internal static string FormatHttp2ConnectionFaulted() - => GetString("Http2ConnectionFaulted"); - - /// - /// The client reset the request stream. - /// - internal static string Http2StreamResetByClient - { - get => GetString("Http2StreamResetByClient"); - } - - /// - /// The client reset the request stream. - /// - internal static string FormatHttp2StreamResetByClient() - => GetString("Http2StreamResetByClient"); - - /// - /// The request stream was aborted. - /// - internal static string Http2StreamAborted - { - get => GetString("Http2StreamAborted"); - } - - /// - /// The request stream was aborted. - /// - internal static string FormatHttp2StreamAborted() - => GetString("Http2StreamAborted"); - - /// - /// The client sent more data than what was available in the flow-control window. - /// - internal static string Http2ErrorFlowControlWindowExceeded - { - get => GetString("Http2ErrorFlowControlWindowExceeded"); - } - - /// - /// The client sent more data than what was available in the flow-control window. - /// - internal static string FormatHttp2ErrorFlowControlWindowExceeded() - => GetString("Http2ErrorFlowControlWindowExceeded"); - - /// - /// CONNECT requests must not send :scheme or :path headers. - /// - internal static string Http2ErrorConnectMustNotSendSchemeOrPath - { - get => GetString("Http2ErrorConnectMustNotSendSchemeOrPath"); - } - - /// - /// CONNECT requests must not send :scheme or :path headers. - /// - internal static string FormatHttp2ErrorConnectMustNotSendSchemeOrPath() - => GetString("Http2ErrorConnectMustNotSendSchemeOrPath"); - - /// - /// The Method '{method}' is invalid. - /// - internal static string Http2ErrorMethodInvalid - { - get => GetString("Http2ErrorMethodInvalid"); - } - - /// - /// The Method '{method}' is invalid. - /// - internal static string FormatHttp2ErrorMethodInvalid(object method) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorMethodInvalid", "method"), method); - - /// - /// The request :path is invalid: '{path}' - /// - internal static string Http2StreamErrorPathInvalid - { - get => GetString("Http2StreamErrorPathInvalid"); - } - - /// - /// The request :path is invalid: '{path}' - /// - internal static string FormatHttp2StreamErrorPathInvalid(object path) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2StreamErrorPathInvalid", "path"), path); - - /// - /// The request :scheme header '{requestScheme}' does not match the transport scheme '{transportScheme}'. - /// - internal static string Http2StreamErrorSchemeMismatch - { - get => GetString("Http2StreamErrorSchemeMismatch"); - } - - /// - /// The request :scheme header '{requestScheme}' does not match the transport scheme '{transportScheme}'. - /// - internal static string FormatHttp2StreamErrorSchemeMismatch(object requestScheme, object transportScheme) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2StreamErrorSchemeMismatch", "requestScheme", "transportScheme"), requestScheme, transportScheme); - - /// - /// Less data received than specified in the Content-Length header. - /// - internal static string Http2StreamErrorLessDataThanLength - { - get => GetString("Http2StreamErrorLessDataThanLength"); - } - - /// - /// Less data received than specified in the Content-Length header. - /// - internal static string FormatHttp2StreamErrorLessDataThanLength() - => GetString("Http2StreamErrorLessDataThanLength"); - - /// - /// More data received than specified in the Content-Length header. - /// - internal static string Http2StreamErrorMoreDataThanLength - { - get => GetString("Http2StreamErrorMoreDataThanLength"); - } - - /// - /// More data received than specified in the Content-Length header. - /// - internal static string FormatHttp2StreamErrorMoreDataThanLength() - => GetString("Http2StreamErrorMoreDataThanLength"); - - /// - /// An error occurred after the response headers were sent, a reset is being sent. - /// - internal static string Http2StreamErrorAfterHeaders - { - get => GetString("Http2StreamErrorAfterHeaders"); - } - - /// - /// An error occurred after the response headers were sent, a reset is being sent. - /// - internal static string FormatHttp2StreamErrorAfterHeaders() - => GetString("Http2StreamErrorAfterHeaders"); - - /// - /// A new stream was refused because this connection has reached its stream limit. - /// - internal static string Http2ErrorMaxStreams - { - get => GetString("Http2ErrorMaxStreams"); - } - - /// - /// A new stream was refused because this connection has reached its stream limit. - /// - internal static string FormatHttp2ErrorMaxStreams() - => GetString("Http2ErrorMaxStreams"); - - /// - /// A value greater than zero is required. - /// - internal static string GreaterThanZeroRequired - { - get => GetString("GreaterThanZeroRequired"); - } - - /// - /// A value greater than zero is required. - /// - internal static string FormatGreaterThanZeroRequired() - => GetString("GreaterThanZeroRequired"); - - /// - /// A value between {min} and {max} is required. - /// - internal static string ArgumentOutOfRange - { - get => GetString("ArgumentOutOfRange"); - } - - /// - /// A value between {min} and {max} is required. - /// - internal static string FormatArgumentOutOfRange(object min, object max) - => string.Format(CultureInfo.CurrentCulture, GetString("ArgumentOutOfRange", "min", "max"), min, max); - - /// - /// Dynamic tables size update did not occur at the beginning of the first header block. - /// - internal static string HPackErrorDynamicTableSizeUpdateNotAtBeginningOfHeaderBlock - { - get => GetString("HPackErrorDynamicTableSizeUpdateNotAtBeginningOfHeaderBlock"); - } - - /// - /// Dynamic tables size update did not occur at the beginning of the first header block. - /// - internal static string FormatHPackErrorDynamicTableSizeUpdateNotAtBeginningOfHeaderBlock() - => GetString("HPackErrorDynamicTableSizeUpdateNotAtBeginningOfHeaderBlock"); - - /// - /// The given buffer was too small to encode any headers. - /// - internal static string HPackErrorNotEnoughBuffer - { - get => GetString("HPackErrorNotEnoughBuffer"); - } - - /// - /// The given buffer was too small to encode any headers. - /// - internal static string FormatHPackErrorNotEnoughBuffer() - => GetString("HPackErrorNotEnoughBuffer"); - - /// - /// The decoded integer exceeds the maximum value of Int32.MaxValue. - /// - internal static string HPackErrorIntegerTooBig - { - get => GetString("HPackErrorIntegerTooBig"); - } - - /// - /// The decoded integer exceeds the maximum value of Int32.MaxValue. - /// - internal static string FormatHPackErrorIntegerTooBig() - => GetString("HPackErrorIntegerTooBig"); - - /// - /// The client closed the connection. - /// - internal static string ConnectionAbortedByClient - { - get => GetString("ConnectionAbortedByClient"); - } - - /// - /// The client closed the connection. - /// - internal static string FormatConnectionAbortedByClient() - => GetString("ConnectionAbortedByClient"); - - /// - /// A frame of type {frameType} was received after stream {streamId} was reset or aborted. - /// - internal static string Http2ErrorStreamAborted - { - get => GetString("Http2ErrorStreamAborted"); - } - - /// - /// A frame of type {frameType} was received after stream {streamId} was reset or aborted. - /// - internal static string FormatHttp2ErrorStreamAborted(object frameType, object streamId) - => string.Format(CultureInfo.CurrentCulture, GetString("Http2ErrorStreamAborted", "frameType", "streamId"), frameType, streamId); - - /// - /// HTTP protocol selection failed. - /// - internal static string ProtocolSelectionFailed - { - get => GetString("ProtocolSelectionFailed"); - } - - /// - /// HTTP protocol selection failed. - /// - internal static string FormatProtocolSelectionFailed() - => GetString("ProtocolSelectionFailed"); - - /// - /// Server shutdown started during connection initialization. - /// - internal static string ServerShutdownDuringConnectionInitialization - { - get => GetString("ServerShutdownDuringConnectionInitialization"); - } - - /// - /// Server shutdown started during connection initialization. - /// - internal static string FormatServerShutdownDuringConnectionInitialization() - => GetString("ServerShutdownDuringConnectionInitialization"); - - /// - /// Cannot call GetMemory() until response has started. Call HttpResponse.StartAsync() before calling GetMemory(). - /// - internal static string StartAsyncBeforeGetMemory - { - get => GetString("StartAsyncBeforeGetMemory"); - } - - /// - /// Cannot call GetMemory() until response has started. Call HttpResponse.StartAsync() before calling GetMemory(). - /// - internal static string FormatStartAsyncBeforeGetMemory() - => GetString("StartAsyncBeforeGetMemory"); - - /// - /// This feature is not supported for HTTP/2 requests except to disable it entirely by setting the rate to null. - /// - internal static string Http2MinDataRateNotSupported - { - get => GetString("Http2MinDataRateNotSupported"); - } - - /// - /// This feature is not supported for HTTP/2 requests except to disable it entirely by setting the rate to null. - /// - internal static string FormatHttp2MinDataRateNotSupported() - => GetString("Http2MinDataRateNotSupported"); - - /// - /// The request trailers are not available yet. They may not be available until the full request body is read. - /// - internal static string RequestTrailersNotAvailable - { - get => GetString("RequestTrailersNotAvailable"); - } - - /// - /// The request trailers are not available yet. They may not be available until the full request body is read. - /// - internal static string FormatRequestTrailersNotAvailable() - => GetString("RequestTrailersNotAvailable"); - - private static string GetString(string name, params string[] formatterNames) - { - var value = _resourceManager.GetString(name); - - System.Diagnostics.Debug.Assert(value != null); - - if (formatterNames != null) - { - for (var i = 0; i < formatterNames.Length; i++) - { - value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}"); - } - } - - return value; - } - } -} diff --git a/src/Servers/Kestrel/Directory.Build.props b/src/Servers/Kestrel/Directory.Build.props index 05b71894da..25e54c7eb1 100644 --- a/src/Servers/Kestrel/Directory.Build.props +++ b/src/Servers/Kestrel/Directory.Build.props @@ -8,6 +8,8 @@ $(MSBuildThisFileDirectory) $(MSBuildThisFileDirectory)shared\ + true + true diff --git a/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationBuilderTests.cs b/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationBuilderTests.cs index 12d32431ae..f3bedad135 100644 --- a/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationBuilderTests.cs +++ b/src/Servers/Kestrel/Kestrel/test/KestrelConfigurationBuilderTests.cs @@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Hosting.Internal; using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Server.Kestrel.Https; using Microsoft.AspNetCore.Testing; +using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -133,7 +134,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Tests serverOptions.ConfigureEndpointDefaults(opt => { - opt.Protocols = HttpProtocols.Http2; + opt.Protocols = HttpProtocols.Http1; }); serverOptions.ConfigureHttpsDefaults(opt => @@ -155,12 +156,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Tests Assert.True(opt.IsHttps); Assert.NotNull(opt.HttpsOptions.ServerCertificate); Assert.Equal(ClientCertificateMode.RequireCertificate, opt.HttpsOptions.ClientCertificateMode); - Assert.Equal(HttpProtocols.Http2, opt.ListenOptions.Protocols); + Assert.Equal(HttpProtocols.Http1, opt.ListenOptions.Protocols); }) .LocalhostEndpoint(5002, opt => { ran2 = true; - Assert.Equal(HttpProtocols.Http2, opt.Protocols); + Assert.Equal(HttpProtocols.Http1, opt.Protocols); }) .Load(); @@ -316,11 +317,23 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Tests } } - [Theory] + [ConditionalTheory] + [InlineData("http1", HttpProtocols.Http1)] + // [InlineData("http2", HttpProtocols.Http2)] // Not supported due to missing ALPN support. https://github.com/dotnet/corefx/issues/33016 + [InlineData("http1AndHttp2", HttpProtocols.Http1AndHttp2)] // Gracefully falls back to HTTP/1 + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.Windows)] + public void DefaultConfigSectionCanSetProtocols_Mac(string input, HttpProtocols expected) + => DefaultConfigSectionCanSetProtocols(input, expected); + + [ConditionalTheory] [InlineData("http1", HttpProtocols.Http1)] [InlineData("http2", HttpProtocols.Http2)] [InlineData("http1AndHttp2", HttpProtocols.Http1AndHttp2)] - public void DefaultConfigSectionCanSetProtocols(string input, HttpProtocols expected) + [OSSkipCondition(OperatingSystems.MacOSX)] + public void DefaultConfigSectionCanSetProtocols_NonMac(string input, HttpProtocols expected) + => DefaultConfigSectionCanSetProtocols(input, expected); + + private void DefaultConfigSectionCanSetProtocols(string input, HttpProtocols expected) { var serverOptions = CreateServerOptions(); var ranDefault = false; @@ -371,11 +384,23 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Tests Assert.True(ran3); } - [Theory] + [ConditionalTheory] + [InlineData("http1", HttpProtocols.Http1)] + // [InlineData("http2", HttpProtocols.Http2)] // Not supported due to missing ALPN support. https://github.com/dotnet/corefx/issues/33016 + [InlineData("http1AndHttp2", HttpProtocols.Http1AndHttp2)] // Gracefully falls back to HTTP/1 + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.Windows)] + public void EndpointConfigSectionCanSetProtocols_Mac(string input, HttpProtocols expected) => + EndpointConfigSectionCanSetProtocols(input, expected); + + [ConditionalTheory] [InlineData("http1", HttpProtocols.Http1)] [InlineData("http2", HttpProtocols.Http2)] [InlineData("http1AndHttp2", HttpProtocols.Http1AndHttp2)] - public void EndpointConfigSectionCanSetProtocols(string input, HttpProtocols expected) + [OSSkipCondition(OperatingSystems.MacOSX)] + public void EndpointConfigSectionCanSetProtocols_NonMac(string input, HttpProtocols expected) => + EndpointConfigSectionCanSetProtocols(input, expected); + + private void EndpointConfigSectionCanSetProtocols(string input, HttpProtocols expected) { var serverOptions = CreateServerOptions(); var ranDefault = false; diff --git a/src/Servers/Kestrel/Transport.Sockets/src/Properties/SocketsStrings.Designer.cs b/src/Servers/Kestrel/Transport.Sockets/src/Properties/SocketsStrings.Designer.cs deleted file mode 100644 index 2d26f8f398..0000000000 --- a/src/Servers/Kestrel/Transport.Sockets/src/Properties/SocketsStrings.Designer.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets -{ - using System.Globalization; - using System.Reflection; - using System.Resources; - - internal static class SocketsStrings - { - private static readonly ResourceManager _resourceManager - = new ResourceManager("Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketsStrings", typeof(SocketsStrings).GetTypeInfo().Assembly); - - /// - /// Only ListenType.IPEndPoint is supported by the Socket Transport. https://go.microsoft.com/fwlink/?linkid=874850 - /// - internal static string OnlyIPEndPointsSupported - { - get => GetString("OnlyIPEndPointsSupported"); - } - - /// - /// Only ListenType.IPEndPoint is supported by the Socket Transport. https://go.microsoft.com/fwlink/?linkid=874850 - /// - internal static string FormatOnlyIPEndPointsSupported() - => GetString("OnlyIPEndPointsSupported"); - - /// - /// Transport is already bound. - /// - internal static string TransportAlreadyBound - { - get => GetString("TransportAlreadyBound"); - } - - /// - /// Transport is already bound. - /// - internal static string FormatTransportAlreadyBound() - => GetString("TransportAlreadyBound"); - - private static string GetString(string name, params string[] formatterNames) - { - var value = _resourceManager.GetString(name); - - System.Diagnostics.Debug.Assert(value != null); - - if (formatterNames != null) - { - for (var i = 0; i < formatterNames.Length; i++) - { - value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}"); - } - } - - return value; - } - } -} diff --git a/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs b/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs index 59cfbbc2c9..eccfa17c2e 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs @@ -19,9 +19,6 @@ using Xunit; namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 { - [OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")] - [SkipOnHelix("https://github.com/aspnet/AspNetCore/issues/10428", Queues = "Debian.8.Amd64.Open")] // Debian 8 uses OpenSSL 1.0.1 which does not support HTTP/2 - [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)] public class HandshakeTests : LoggedTest { private static X509Certificate2 _x509Certificate2 = TestResources.GetTestCertificate(); @@ -40,6 +37,30 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 } [ConditionalFact] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.Windows)] + // Mac SslStream is missing ALPN support: https://github.com/dotnet/corefx/issues/30492 + public void TlsAndHttp2NotSupportedOnMac() + { + var ex = Assert.Throws(() => new TestServer(context => + { + throw new NotImplementedException(); + }, new TestServiceContext(LoggerFactory), + kestrelOptions => + { + kestrelOptions.Listen(IPAddress.Loopback, 0, listenOptions => + { + listenOptions.Protocols = HttpProtocols.Http2; + listenOptions.UseHttps(_x509Certificate2); + }); + })); + + Assert.Equal("HTTP/2 over TLS is not supported on OSX due to missing ALPN support.", ex.Message); + } + + [ConditionalFact] + [OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")] + [SkipOnHelix("https://github.com/aspnet/AspNetCore/issues/10428", Queues = "Debian.8.Amd64.Open")] // Debian 8 uses OpenSSL 1.0.1 which does not support HTTP/2 + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)] public async Task TlsAlpnHandshakeSelectsHttp2From1and2() { using (var server = new TestServer(context => @@ -68,6 +89,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 } [ConditionalFact] + [OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")] + [SkipOnHelix("https://github.com/aspnet/AspNetCore/issues/10428", Queues = "Debian.8.Amd64.Open")] // Debian 8 uses OpenSSL 1.0.1 which does not support HTTP/2 + [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)] public async Task TlsAlpnHandshakeSelectsHttp2() { using (var server = new TestServer(context =>