Add NTLM feature detection and more tests (dotnet/corefx#35200)
authorDavid Shulman <david.shulman@microsoft.com>
Sun, 10 Feb 2019 16:24:06 +0000 (08:24 -0800)
committerGitHub <noreply@github.com>
Sun, 10 Feb 2019 16:24:06 +0000 (08:24 -0800)
commit8ddab057fd7802f937aafd3bc1f57b48fe470899
tree324622ca8ada2349785ff72ce4ea7074b172056e
parent4af9a75dafe2e98dd739304027d894eb3d90c636
Add NTLM feature detection and more tests (dotnet/corefx#35200)

This PR works toward the goal of our Enterprise Scenarios. I added logic in the Unix
PAL gssapi layer to detect whether the NTLM plugin is installed. This is useful both
in the product code (to return better exception messages) and the test code (to
skip NTLM tests if needed).

Refactored some of the Common System.Net.Configuration logic for tests. Added new
environment variable logic to separate between domain-joined and standalone server
environments.

Add new tests to validate NTLM end-to-end connectivity. Opened some new issues
discovered along with way regarding HTTP/2 and Windows authentication.

To run these new tests simply set the 3 environment variables to point to the
standalone windows server environment.  For example, on Linux:

```
export COREFX_WINDOWSSERVER_HTTPHOST=somewindowsmachine.contoso.com
export COREFX_NET_SERVER_USERNAME=someusername
export COREFX_NET_SERVER_PASSWORD=somepassword
```

I have already deployed a standalone Windows server for these tests but
we're not ready yet to have the tests always run in CI.

Contributes to dotnet/corefx#34878

Commit migrated from https://github.com/dotnet/corefx/commit/fe6f55b496489dbd02cdd207c0b1f9112b560763
16 files changed:
src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs [new file with mode: 0644]
src/libraries/Common/src/Microsoft/Win32/SafeHandles/GssSafeHandles.cs
src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs [new file with mode: 0644]
src/libraries/Common/tests/System/Net/Capability.Security.Windows.cs [new file with mode: 0644]
src/libraries/Common/tests/System/Net/Configuration.Http.cs
src/libraries/Common/tests/System/Net/Configuration.Security.cs
src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.c
src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.h
src/libraries/System.Data.SqlClient/src/System.Data.SqlClient.csproj
src/libraries/System.Net.Http/src/System.Net.Http.csproj
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Authentication.cs
src/libraries/System.Net.Http/tests/FunctionalTests/PlatformHandlerTest.cs
src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs
src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj
src/libraries/System.Net.Mail/src/System.Net.Mail.csproj
src/libraries/System.Net.Security/src/System.Net.Security.csproj