Skip to content

Commit 8ecc77a

Browse files
authored
Enable client cert renegotiation tests on linux (#35084)
1 parent 19efbcf commit 8ecc77a

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ void ConfigureListenOptions(ListenOptions listenOptions)
531531
[ConditionalTheory]
532532
[InlineData(HttpProtocols.Http1)]
533533
[InlineData(HttpProtocols.Http1AndHttp2)] // Make sure turning on Http/2 doesn't regress HTTP/1
534-
[OSSkipCondition(OperatingSystems.MacOSX | OperatingSystems.Linux, SkipReason = "Not supported yet.")]
534+
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing platform support.")]
535+
[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/33566#issuecomment-892031659", Queues = HelixConstants.RedhatAmd64)] // Outdated OpenSSL client
535536
public async Task CanRenegotiateForClientCertificate(HttpProtocols httpProtocols)
536537
{
537538
void ConfigureListenOptions(ListenOptions listenOptions)
@@ -540,6 +541,7 @@ void ConfigureListenOptions(ListenOptions listenOptions)
540541
listenOptions.UseHttps(options =>
541542
{
542543
options.ServerCertificate = _x509Certificate2;
544+
options.SslProtocols = SslProtocols.Tls12; // Linux doesn't support renegotiate on TLS1.3 yet. https://github.com/dotnet/runtime/issues/55757
543545
options.ClientCertificateMode = ClientCertificateMode.DelayCertificate;
544546
options.AllowAnyClientCertificate();
545547
});
@@ -612,7 +614,8 @@ void ConfigureListenOptions(ListenOptions listenOptions)
612614
}
613615

614616
[ConditionalFact]
615-
[OSSkipCondition(OperatingSystems.MacOSX | OperatingSystems.Linux, SkipReason = "Not supported yet.")]
617+
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing platform support.")]
618+
[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/33566#issuecomment-892031659", Queues = HelixConstants.RedhatAmd64)] // Outdated OpenSSL client
616619
public async Task CanRenegotiateForTlsCallbackOptions()
617620
{
618621
void ConfigureListenOptions(ListenOptions listenOptions)
@@ -625,6 +628,7 @@ void ConfigureListenOptions(ListenOptions listenOptions)
625628
return ValueTask.FromResult(new SslServerAuthenticationOptions()
626629
{
627630
ServerCertificate = _x509Certificate2,
631+
EnabledSslProtocols = SslProtocols.Tls12, // Linux doesn't support renegotiate on TLS1.3 yet. https://github.com/dotnet/runtime/issues/55757
628632
ClientCertificateRequired = false,
629633
RemoteCertificateValidationCallback = (_, _, _, _) => true,
630634
});
@@ -658,7 +662,8 @@ void ConfigureListenOptions(ListenOptions listenOptions)
658662
}
659663

660664
[ConditionalFact]
661-
[OSSkipCondition(OperatingSystems.MacOSX | OperatingSystems.Linux, SkipReason = "Not supported yet.")]
665+
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing platform support.")]
666+
[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/33566#issuecomment-892031659", Queues = HelixConstants.RedhatAmd64)] // Outdated OpenSSL client
662667
public async Task CanRenegotiateForClientCertificateOnHttp1CanReturnNoCert()
663668
{
664669
void ConfigureListenOptions(ListenOptions listenOptions)
@@ -667,6 +672,7 @@ void ConfigureListenOptions(ListenOptions listenOptions)
667672
listenOptions.UseHttps(options =>
668673
{
669674
options.ServerCertificate = _x509Certificate2;
675+
options.SslProtocols = SslProtocols.Tls12; // Linux doesn't support renegotiate on TLS1.3 yet. https://github.com/dotnet/runtime/issues/55757
670676
options.ClientCertificateMode = ClientCertificateMode.DelayCertificate;
671677
options.AllowAnyClientCertificate();
672678
});
@@ -707,7 +713,8 @@ void ConfigureListenOptions(ListenOptions listenOptions)
707713
[ConditionalFact]
708714
// TLS 1.2 and lower have to renegotiate the whole connection to get a client cert, and if that hits an error
709715
// then the connection is aborted.
710-
[OSSkipCondition(OperatingSystems.MacOSX | OperatingSystems.Linux, SkipReason = "Not supported yet.")]
716+
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing platform support.")]
717+
[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/33566#issuecomment-892031659", Queues = HelixConstants.RedhatAmd64)] // Outdated OpenSSL client
711718
public async Task RenegotiateForClientCertificateOnPostWithoutBufferingThrows_TLS12()
712719
{
713720
void ConfigureListenOptions(ListenOptions listenOptions)
@@ -752,7 +759,8 @@ void ConfigureListenOptions(ListenOptions listenOptions)
752759
// TLS 1.3 uses a new client cert negotiation extension that doesn't cause the connection to abort
753760
// for this error.
754761
[MinimumOSVersion(OperatingSystems.Windows, "10.0.20145")] // Needs a preview version with TLS 1.3 enabled.
755-
[OSSkipCondition(OperatingSystems.MacOSX | OperatingSystems.Linux, SkipReason = "Not supported yet.")]
762+
[OSSkipCondition(OperatingSystems.MacOSX | OperatingSystems.Linux, SkipReason = "https://github.com/dotnet/runtime/issues/55757")]
763+
[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/33566#issuecomment-892031659", Queues = HelixConstants.RedhatAmd64)] // Outdated OpenSSL client
756764
public async Task RenegotiateForClientCertificateOnPostWithoutBufferingThrows_TLS13()
757765
{
758766
void ConfigureListenOptions(ListenOptions listenOptions)
@@ -888,7 +896,8 @@ await stream.AuthenticateAsClientAsync(new SslClientAuthenticationOptions()
888896
}
889897

890898
[ConditionalFact]
891-
[OSSkipCondition(OperatingSystems.MacOSX | OperatingSystems.Linux, SkipReason = "Not supported yet.")]
899+
[OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing platform support.")]
900+
[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/33566#issuecomment-892031659", Queues = HelixConstants.RedhatAmd64)] // Outdated OpenSSL client
892901
public async Task CanRenegotiateForClientCertificateOnPostIfDrained()
893902
{
894903
void ConfigureListenOptions(ListenOptions listenOptions)
@@ -897,6 +906,7 @@ void ConfigureListenOptions(ListenOptions listenOptions)
897906
listenOptions.UseHttps(options =>
898907
{
899908
options.ServerCertificate = _x509Certificate2;
909+
options.SslProtocols = SslProtocols.Tls12; // Linux doesn't support renegotiate on TLS1.3 yet. https://github.com/dotnet/runtime/issues/55757
900910
options.ClientCertificateMode = ClientCertificateMode.DelayCertificate;
901911
options.AllowAnyClientCertificate();
902912
});

src/Testing/src/xunit/HelixConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ public static class HelixConstants
77
{
88
public const string Windows10Arm64 = "Windows.10.Arm64v8.Open;";
99
public const string DebianArm64 = "Debian.9.Arm64.Open;";
10+
public const string RedhatAmd64 = "Redhat.7.Amd64.Open;";
1011
}
1112
}

0 commit comments

Comments
 (0)