Merge pull request #22559 from dotnet-maestro-bot/merge/release/5.0-preview6-to-master

[automated] Merge branch 'release/5.0-preview6' => 'master'
This commit is contained in:
msftbot[bot] 2020-06-05 04:22:57 +00:00 committed by GitHub
commit d15672bb8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 4 deletions

View File

@ -602,4 +602,7 @@ For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?l
<data name="GreaterThanOrEqualToZeroRequired" xml:space="preserve">
<value>A value greater than or equal to zero is required.</value>
</data>
<data name="HttpsConnectionEstablished" xml:space="preserve">
<value>Connection "{connectionId}" established using the following protocol: {protocol}</value>
</data>
</root>

View File

@ -24,7 +24,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https
public HttpsConnectionAdapterOptions()
{
ClientCertificateMode = ClientCertificateMode.NoCertificate;
SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11;
HandshakeTimeout = TimeSpan.FromSeconds(10);
}
@ -61,7 +60,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https
public Func<X509Certificate2, X509Chain, SslPolicyErrors, bool> ClientCertificateValidation { get; set; }
/// <summary>
/// Specifies allowable SSL protocols. Defaults to <see cref="SslProtocols.Tls12" /> and <see cref="SslProtocols.Tls11"/>.
/// Specifies allowable SSL protocols. Defaults to <see cref="SslProtocols.None" /> which allows the operating system to choose the best protocol to use,
/// and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this default.
/// </summary>
public SslProtocols SslProtocols { get; set; }

View File

@ -252,6 +252,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
KestrelEventSource.Log.TlsHandshakeStop(context, feature);
_logger.LogDebug(3, CoreStrings.HttpsConnectionEstablished, context.ConnectionId, sslStream.SslProtocol);
var originalTransport = context.Transport;
try

View File

@ -362,12 +362,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
}
[Fact]
public async Task DoesNotSupportTls10()
public async Task Tls10CanBeDisabled()
{
void ConfigureListenOptions(ListenOptions listenOptions)
{
listenOptions.UseHttps(options =>
{
options.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11;
options.ServerCertificate = _x509Certificate2;
options.ClientCertificateMode = ClientCertificateMode.RequireCertificate;
options.AllowAnyClientCertificate();

View File

@ -366,7 +366,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
new TestServiceContext(LoggerFactory),
listenOptions =>
{
listenOptions.UseHttps(TestResources.GetTestCertificate("no_extensions.pfx"));
listenOptions.UseHttps(TestResources.GetTestCertificate("no_extensions.pfx"), httpsOptions =>
{
httpsOptions.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11;
});
}))
{
using (var connection = server.CreateConnection())