Skip to content

Commit 33e5d24

Browse files
[release/9.0-staging] Skip SSL key log test for OpenSSL 3.5+ (#116687)
* Skip SSL key log test for openssl 3.5+ * Minor changes, active issue comment * Conditional return * Add IsOpenSsl3_5 to platform detection helper --------- Co-authored-by: Roman Konecny <rokonecn@microsoft.com>
1 parent 22cf0cd commit 33e5d24

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ public static partial class PlatformDetection
5151

5252
private static readonly Version s_openssl3Version = new Version(3, 0, 0);
5353
private static readonly Version s_openssl3_4Version = new Version(3, 4, 0);
54+
private static readonly Version s_openssl3_5Version = new Version(3, 5, 0);
5455

5556
public static bool IsOpenSsl3 => IsOpenSslVersionAtLeast(s_openssl3Version);
5657
public static bool IsOpenSsl3_4 => IsOpenSslVersionAtLeast(s_openssl3_4Version);
58+
public static bool IsOpenSsl3_5 => IsOpenSslVersionAtLeast(s_openssl3_5Version);
5759

5860
/// <summary>
5961
/// If gnulibc is available, returns the release, such as "stable".

src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public SslStreamRemoteExecutorTests()
2525
[PlatformSpecific(TestPlatforms.Linux)] // SSLKEYLOGFILE is only supported on Linux for SslStream
2626
[InlineData(true)]
2727
[InlineData(false)]
28+
//[ActiveIssue("https://github.com/dotnet/runtime/issues/116473")]
2829
public async Task SslKeyLogFile_IsCreatedAndFilled(bool enabledBySwitch)
2930
{
3031
if (PlatformDetection.IsDebugLibrary(typeof(SslStream).Assembly) && !enabledBySwitch)
@@ -34,6 +35,13 @@ public async Task SslKeyLogFile_IsCreatedAndFilled(bool enabledBySwitch)
3435
return;
3536
}
3637

38+
if (PlatformDetection.IsOpenSsl3_5 && !enabledBySwitch)
39+
{
40+
// OpenSSL 3.5 and later versions log into file in SSLKEYLOGFILE environment variable by default,
41+
// regardless of AppContext switch.
42+
return;
43+
}
44+
3745
var psi = new ProcessStartInfo();
3846
var tempFile = Path.GetTempFileName();
3947
psi.Environment.Add("SSLKEYLOGFILE", tempFile);

0 commit comments

Comments
 (0)