Skip to content

Allow NTLM tests on newer Linux distributions #113414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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 @@ -9,16 +9,21 @@ public static partial class Capability
{
public static bool IsNtlmInstalled()
{
if (OperatingSystem.IsBrowser() || OperatingSystem.IsWasi() )
if (OperatingSystem.IsBrowser() || OperatingSystem.IsWasi())
{
return false;
}
return
// Linux bionic uses managed NTLM implementation
(OperatingSystem.IsLinux() && RuntimeInformation.RuntimeIdentifier.StartsWith("linux-bionic-", StringComparison.Ordinal)) ||
// GSS on Linux does not work with OpenSSL 3.0. Fix was submitted to gss-ntlm but it will take a while to make to
// all supported distributions. The second part of the check should be removed when it does.
Interop.NetSecurityNative.IsNtlmInstalled() && (!PlatformDetection.IsOpenSslSupported || PlatformDetection.OpenSslVersion.Major < 3);
// GSS on Linux does not work with OpenSSL 3.0. Fix was submitted to gss-ntlm (v 1.2.0+) but it will take a while to make to
// all supported distributions. The second part of the check should be removed when it does. In the meantime, we whitelist
// distributions containing the updated gss-ntlm package.
Interop.NetSecurityNative.IsNtlmInstalled() && (!PlatformDetection.IsOpenSslSupported || PlatformDetection.OpenSslVersion.Major < 3
|| PlatformDetection.IsUbuntu23OrLater
// || PlatformDetection.IsFedora40OrLater
// || PlatformDetection.IsDebian12OrLater
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public static partial class PlatformDetection
public static bool IsLinuxBionic => IsBionic();
public static bool IsRedHatFamily => IsRedHatFamilyAndVersion();
public static bool IsAzureLinux => IsDistroAndVersionOrHigher("azurelinux", 3);
public static bool IsUbuntu23OrLater => IsDistroAndVersionOrHigher("ubuntu", 23);
public static bool IsFedora40OrLater => IsDistroAndVersionOrHigher("fedora", 40);
public static bool IsDebian12OrLater => IsDistroAndVersionOrHigher("debian", 12);

public static bool IsMonoLinuxArm64 => IsMonoRuntime && IsLinux && IsArm64Process;
public static bool IsNotMonoLinuxArm64 => !IsMonoLinuxArm64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public void Package_Supported_NTLM()
}

[ConditionalFact(nameof(IsNtlmUnavailable))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/111639", typeof(PlatformDetection), nameof(PlatformDetection.IsUbuntu24))]
public void Package_Unsupported_NTLM()
{
NegotiateAuthenticationClientOptions clientOptions = new NegotiateAuthenticationClientOptions { Package = "NTLM", Credential = s_testCredentialRight, TargetName = "HTTP/foo" };
Expand Down
Loading