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:
commit
d15672bb8f
|
|
@ -602,4 +602,7 @@ For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?l
|
||||||
<data name="GreaterThanOrEqualToZeroRequired" xml:space="preserve">
|
<data name="GreaterThanOrEqualToZeroRequired" xml:space="preserve">
|
||||||
<value>A value greater than or equal to zero is required.</value>
|
<value>A value greater than or equal to zero is required.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="HttpsConnectionEstablished" xml:space="preserve">
|
||||||
|
<value>Connection "{connectionId}" established using the following protocol: {protocol}</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
@ -24,7 +24,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https
|
||||||
public HttpsConnectionAdapterOptions()
|
public HttpsConnectionAdapterOptions()
|
||||||
{
|
{
|
||||||
ClientCertificateMode = ClientCertificateMode.NoCertificate;
|
ClientCertificateMode = ClientCertificateMode.NoCertificate;
|
||||||
SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11;
|
|
||||||
HandshakeTimeout = TimeSpan.FromSeconds(10);
|
HandshakeTimeout = TimeSpan.FromSeconds(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,7 +60,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https
|
||||||
public Func<X509Certificate2, X509Chain, SslPolicyErrors, bool> ClientCertificateValidation { get; set; }
|
public Func<X509Certificate2, X509Chain, SslPolicyErrors, bool> ClientCertificateValidation { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public SslProtocols SslProtocols { get; set; }
|
public SslProtocols SslProtocols { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -252,6 +252,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
|
||||||
|
|
||||||
KestrelEventSource.Log.TlsHandshakeStop(context, feature);
|
KestrelEventSource.Log.TlsHandshakeStop(context, feature);
|
||||||
|
|
||||||
|
_logger.LogDebug(3, CoreStrings.HttpsConnectionEstablished, context.ConnectionId, sslStream.SslProtocol);
|
||||||
|
|
||||||
var originalTransport = context.Transport;
|
var originalTransport = context.Transport;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -362,12 +362,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task DoesNotSupportTls10()
|
public async Task Tls10CanBeDisabled()
|
||||||
{
|
{
|
||||||
void ConfigureListenOptions(ListenOptions listenOptions)
|
void ConfigureListenOptions(ListenOptions listenOptions)
|
||||||
{
|
{
|
||||||
listenOptions.UseHttps(options =>
|
listenOptions.UseHttps(options =>
|
||||||
{
|
{
|
||||||
|
options.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11;
|
||||||
options.ServerCertificate = _x509Certificate2;
|
options.ServerCertificate = _x509Certificate2;
|
||||||
options.ClientCertificateMode = ClientCertificateMode.RequireCertificate;
|
options.ClientCertificateMode = ClientCertificateMode.RequireCertificate;
|
||||||
options.AllowAnyClientCertificate();
|
options.AllowAnyClientCertificate();
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
new TestServiceContext(LoggerFactory),
|
new TestServiceContext(LoggerFactory),
|
||||||
listenOptions =>
|
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())
|
using (var connection = server.CreateConnection())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue