@@ -50,11 +50,6 @@ public async Task HttpClientHandler_Authentication_Succeeds(string authenticateH
50
50
return ;
51
51
}
52
52
53
- // Digest authentication does not work with domain credentials on CurlHandler. This is blocked by the behavior of LibCurl.
54
- NetworkCredential credentials = ( IsCurlHandler && authenticateHeader . ToLowerInvariant ( ) . Contains ( "digest" ) ) ?
55
- s_credentialsNoDomain :
56
- s_credentials ;
57
-
58
53
var options = new LoopbackServer . Options { Domain = Domain , Username = Username , Password = Password } ;
59
54
await LoopbackServer . CreateServerAsync ( async ( server , url ) =>
60
55
{
@@ -65,7 +60,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
65
60
server . AcceptConnectionSendResponseAndCloseAsync ( HttpStatusCode . Unauthorized , serverAuthenticateHeader ) ;
66
61
67
62
await TestHelper . WhenAllCompletedOrAnyFailedWithTimeout ( TestHelper . PassingTestTimeoutMilliseconds ,
68
- CreateAndValidateRequest ( handler , url , result ? HttpStatusCode . OK : HttpStatusCode . Unauthorized , credentials ) , serverTask ) ;
63
+ CreateAndValidateRequest ( handler , url , result ? HttpStatusCode . OK : HttpStatusCode . Unauthorized , s_credentials ) , serverTask ) ;
69
64
} , options ) ;
70
65
}
71
66
@@ -90,7 +85,7 @@ public async Task HttpClientHandler_MultipleAuthenticateHeaders_WithSameAuth_Suc
90
85
[ InlineData ( "WWW-Authenticate: Digest realm=\" hello\" , nonce=\" hello\" , algorithm=MD5\r \n WWW-Authenticate: Basic realm=\" hello\" \r \n " ) ]
91
86
public async Task HttpClientHandler_MultipleAuthenticateHeaders_Succeeds ( string authenticateHeader )
92
87
{
93
- if ( PlatformDetection . IsWindowsNanoServer || ( IsCurlHandler && authenticateHeader . Contains ( "Digest" ) ) )
88
+ if ( PlatformDetection . IsWindowsNanoServer )
94
89
{
95
90
// TODO: #28065: Fix failing authentication test cases on different httpclienthandlers.
96
91
return ;
@@ -110,7 +105,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
110
105
[ InlineData ( "WWW-Authenticate: Basic realm=\" hello\" \r \n WWW-Authenticate: Digest realm=\" hello\" , nonce=\" hello\" , algorithm=MD5\r \n WWW-Authenticate: NTLM\r \n " , "Digest" , "Negotiate" ) ]
111
106
public async Task HttpClientHandler_MultipleAuthenticateHeaders_PicksSupported ( string authenticateHeader , string supportedAuth , string unsupportedAuth )
112
107
{
113
- if ( PlatformDetection . IsWindowsNanoServer || ( IsCurlHandler && authenticateHeader . Contains ( "Digest" ) ) )
108
+ if ( PlatformDetection . IsWindowsNanoServer )
114
109
{
115
110
// TODO: #28065: Fix failing authentication test cases on different httpclienthandlers.
116
111
return ;
@@ -159,13 +154,9 @@ public static IEnumerable<object[]> Authentication_TestData()
159
154
yield return new object [ ] { $ "Basic realm=\" testrealm\" , " +
160
155
$ "Digest realm=\" testrealm\" , nonce=\" { Convert . ToBase64String ( Encoding . UTF8 . GetBytes ( $ "{ DateTimeOffset . UtcNow } :XMh;z+$5|`i6Hx}}") ) } \" , algorithm=MD5", true } ;
161
156
162
- if ( PlatformDetection . IsNetCore )
163
- {
164
- // TODO: #28060: Fix failing authentication test cases on Framework run.
165
- yield return new object [ ] { "Basic something, Digest something" , false } ;
166
- yield return new object [ ] { $ "Digest realm=\" testrealm\" , nonce=\" testnonce\" , algorithm=MD5 " +
167
- $ "Basic realm=\" testrealm\" ", false } ;
168
- }
157
+ yield return new object [ ] { "Basic something, Digest something" , false } ;
158
+ yield return new object [ ] { $ "Digest realm=\" testrealm\" , nonce=\" testnonce\" , algorithm=MD5 " +
159
+ $ "Basic realm=\" testrealm\" ", false } ;
169
160
}
170
161
171
162
[ Theory ]
@@ -177,13 +168,6 @@ public static IEnumerable<object[]> Authentication_TestData()
177
168
[ InlineData ( "Negotiate" ) ]
178
169
public async Task PreAuthenticate_NoPreviousAuthenticatedRequests_NoCredentialsSent ( string credCacheScheme )
179
170
{
180
- if ( IsCurlHandler && credCacheScheme != null )
181
- {
182
- // When provided with a credential that targets just one auth scheme,
183
- // libcurl will often proactively send an auth header.
184
- return ;
185
- }
186
-
187
171
const int NumRequests = 3 ;
188
172
await LoopbackServer . CreateClientAndServerAsync ( async uri =>
189
173
{
@@ -226,13 +210,6 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
226
210
[ InlineData ( "Basic" , "WWW-Authenticate: Basic realm=\" hello\" \r \n " ) ]
227
211
public async Task PreAuthenticate_FirstRequestNoHeaderAndAuthenticates_SecondRequestPreauthenticates ( string credCacheScheme , string authResponse )
228
212
{
229
- if ( IsCurlHandler && credCacheScheme != null )
230
- {
231
- // When provided with a credential that targets just one auth scheme,
232
- // libcurl will often proactively send an auth header.
233
- return ;
234
- }
235
-
236
213
await LoopbackServer . CreateClientAndServerAsync ( async uri =>
237
214
{
238
215
using ( HttpClientHandler handler = CreateHttpClientHandler ( ) )
@@ -439,13 +416,6 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
439
416
// Third request, contains Basic auth header but challenges anyway
440
417
headers = headers = await server . AcceptConnectionSendResponseAndCloseAsync ( HttpStatusCode . Unauthorized , "WWW-Authenticate: Basic realm=\" hello\" \r \n " ) ;
441
418
Assert . Contains ( headers , header => header . Contains ( "Authorization" ) ) ;
442
-
443
- if ( IsNetfxHandler )
444
- {
445
- // For some reason, netfx tries one more time.
446
- headers = headers = await server . AcceptConnectionSendResponseAndCloseAsync ( HttpStatusCode . Unauthorized , "WWW-Authenticate: Basic realm=\" hello\" \r \n " ) ;
447
- Assert . Contains ( headers , header => header . Contains ( "Authorization" ) ) ;
448
- }
449
419
} ) ;
450
420
}
451
421
@@ -458,13 +428,6 @@ public async Task PreAuthenticate_SuccessfulBasic_ThenDigestChallenged()
458
428
return ;
459
429
}
460
430
461
- if ( IsCurlHandler )
462
- {
463
- // When provided with a credential that targets just one auth scheme,
464
- // libcurl will often proactively send an auth header.
465
- return ;
466
- }
467
-
468
431
await LoopbackServer . CreateClientAndServerAsync ( async uri =>
469
432
{
470
433
using ( HttpClientHandler handler = CreateHttpClientHandler ( ) )
@@ -503,16 +466,14 @@ public static IEnumerable<object[]> ServerUsesWindowsAuthentication_MemberData()
503
466
string server = Configuration . Http . WindowsServerHttpHost ;
504
467
string authEndPoint = "showidentity.ashx" ;
505
468
506
- yield return new object [ ] { $ "http://{ server } /test/auth/ntlm/{ authEndPoint } ", false } ;
507
- yield return new object [ ] { $ "https://{ server } /test/auth/ntlm/{ authEndPoint } ", false } ;
469
+ yield return new object [ ] { $ "http://{ server } /test/auth/ntlm/{ authEndPoint } " } ;
470
+ yield return new object [ ] { $ "https://{ server } /test/auth/ntlm/{ authEndPoint } " } ;
508
471
509
- // Curlhandler (due to libcurl bug) cannot do Negotiate (SPNEGO) Kerberos to NTLM fallback.
510
- yield return new object [ ] { $ "http://{ server } /test/auth/negotiate/{ authEndPoint } ", true } ;
511
- yield return new object [ ] { $ "https://{ server } /test/auth/negotiate/{ authEndPoint } ", true } ;
472
+ yield return new object [ ] { $ "http://{ server } /test/auth/negotiate/{ authEndPoint } " } ;
473
+ yield return new object [ ] { $ "https://{ server } /test/auth/negotiate/{ authEndPoint } " } ;
512
474
513
475
// Server requires TLS channel binding token (cbt) with NTLM authentication.
514
- // CurlHandler (due to libcurl bug) cannot do NTLM authentication with cbt.
515
- yield return new object [ ] { $ "https://{ server } /test/auth/ntlm-epa/{ authEndPoint } ", true } ;
476
+ yield return new object [ ] { $ "https://{ server } /test/auth/ntlm-epa/{ authEndPoint } " } ;
516
477
}
517
478
518
479
private static bool IsNtlmInstalled => Capability . IsNtlmInstalled ( ) ;
@@ -575,11 +536,6 @@ public async Task Proxy_DomainJoinedProxyServerUsesKerberos_Success(Uri server)
575
536
[ ConditionalFact ( nameof ( IsDomainJoinedServerAvailable ) ) ]
576
537
public async Task Credentials_DomainJoinedServerUsesKerberos_Success ( )
577
538
{
578
- if ( IsCurlHandler )
579
- {
580
- throw new SkipTestException ( "Skipping test on CurlHandler (libCurl)" ) ;
581
- }
582
-
583
539
using ( HttpClientHandler handler = CreateHttpClientHandler ( ) )
584
540
using ( HttpClient client = CreateHttpClient ( handler ) )
585
541
{
@@ -598,7 +554,7 @@ public async Task Credentials_DomainJoinedServerUsesKerberos_Success()
598
554
[ ConditionalFact ( nameof ( IsDomainJoinedServerAvailable ) ) ]
599
555
public async Task Credentials_DomainJoinedServerUsesKerberos_UseIpAddressAndHostHeader_Success ( )
600
556
{
601
- if ( IsCurlHandler || IsWinHttpHandler )
557
+ if ( IsWinHttpHandler )
602
558
{
603
559
throw new SkipTestException ( "Skipping test on platform handlers (CurlHandler, WinHttpHandler)" ) ;
604
560
}
@@ -628,13 +584,8 @@ public async Task Credentials_DomainJoinedServerUsesKerberos_UseIpAddressAndHost
628
584
629
585
[ ConditionalTheory ( nameof ( IsNtlmInstalled ) , nameof ( IsWindowsServerAvailable ) ) ]
630
586
[ MemberData ( nameof ( ServerUsesWindowsAuthentication_MemberData ) ) ]
631
- public async Task Credentials_ServerUsesWindowsAuthentication_Success ( string server , bool skipOnCurlHandler )
587
+ public async Task Credentials_ServerUsesWindowsAuthentication_Success ( string server )
632
588
{
633
- if ( IsCurlHandler && skipOnCurlHandler )
634
- {
635
- throw new SkipTestException ( "CurlHandler (libCurl) doesn't handle Negotiate with NTLM fallback nor CBT" ) ;
636
- }
637
-
638
589
using ( HttpClientHandler handler = CreateHttpClientHandler ( ) )
639
590
using ( HttpClient client = CreateHttpClient ( handler ) )
640
591
{
@@ -656,11 +607,6 @@ public async Task Credentials_ServerUsesWindowsAuthentication_Success(string ser
656
607
[ InlineData ( "Negotiate" ) ]
657
608
public async Task Credentials_ServerChallengesWithWindowsAuth_ClientSendsWindowsAuthHeader ( string authScheme )
658
609
{
659
- if ( authScheme == "Negotiate" && IsCurlHandler )
660
- {
661
- throw new SkipTestException ( "CurlHandler (libCurl) doesn't handle Negotiate with NTLM fallback" ) ;
662
- }
663
-
664
610
await LoopbackServerFactory . CreateClientAndServerAsync (
665
611
async uri =>
666
612
{
0 commit comments