Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ public static partial class PlatformDetection

private static readonly Version s_openssl3Version = new Version(3, 0, 0);
private static readonly Version s_openssl3_4Version = new Version(3, 4, 0);
private static readonly Version s_openssl3_5Version = new Version(3, 5, 0);

public static bool IsOpenSsl3 => IsOpenSslVersionAtLeast(s_openssl3Version);
public static bool IsOpenSsl3_4 => IsOpenSslVersionAtLeast(s_openssl3_4Version);
public static bool IsOpenSsl3_5 => IsOpenSslVersionAtLeast(s_openssl3_5Version);

/// <summary>
/// If gnulibc is available, returns the release, such as "stable".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public SslStreamRemoteExecutorTests()
[PlatformSpecific(TestPlatforms.Linux)] // SSLKEYLOGFILE is only supported on Linux for SslStream
[InlineData(true)]
[InlineData(false)]
//[ActiveIssue("https://github.com/dotnet/runtime/issues/116473")]
public async Task SslKeyLogFile_IsCreatedAndFilled(bool enabledBySwitch)
{
if (PlatformDetection.IsDebugLibrary(typeof(SslStream).Assembly) && !enabledBySwitch)
Expand All @@ -34,6 +35,13 @@ public async Task SslKeyLogFile_IsCreatedAndFilled(bool enabledBySwitch)
return;
}

if (PlatformDetection.IsOpenSsl3_5 && !enabledBySwitch)
{
// OpenSSL 3.5 and later versions log into file in SSLKEYLOGFILE environment variable by default,
// regardless of AppContext switch.
return;
}

var psi = new ProcessStartInfo();
var tempFile = Path.GetTempFileName();
psi.Environment.Add("SSLKEYLOGFILE", tempFile);
Expand Down