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 @@ -55,6 +55,11 @@ public static partial class PlatformDetection
GetOpenSslVersion() :
throw new PlatformNotSupportedException();

private static readonly Version s_openssl3Version = new Version(3, 0, 0);
public static bool IsOpenSsl3 => !IsOSXLike && !IsWindows && !IsAndroid && !IsBrowser ?
GetOpenSslVersion() >= s_openssl3Version :
false;

/// <summary>
/// If gnulibc is available, returns the release, such as "stable".
/// Otherwise returns "glibc_not_found".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ public static void TestSubjectAlternativeName_Unix()
sanExtension);

string s = asnData.Format(false);
bool isOpenSsl3 = PlatformDetection.IsOpenSsl3;

string expected = string.Join(
", ",
// Choice[0]: OtherName
"othername:<unsupported>",
isOpenSsl3 ? "othername: UPN::[email protected]" : "othername:<unsupported>",
// Choice[1]: Rfc822Name (EmailAddress)
"email:[email protected]",
// Choice[2]: DnsName
Expand All @@ -123,7 +124,7 @@ public static void TestSubjectAlternativeName_Unix()
// Choice[7]: IPAddress (IPv6)
"IP Address:2001:DB8:AC10:FE01:0:0:0:0",
// Choice[7]: IPAddress (unknown type)
"IP Address:<invalid>",
isOpenSsl3 ? "IP Address:<invalid length=15>" : "IP Address:<invalid>",
// Choice[7]: IPAddress (IPv4, longer string)
"IP Address:255.255.255.255",
// Choice[7]: IPAddress (IPv4, medium string)
Expand Down