@@ -459,6 +459,9 @@ class HTTPClientTests: XCTestCase {
459
459
}
460
460
461
461
func testNoContentLengthForSSLUncleanShutdown( ) throws {
462
+ // NIOTS deals with ssl unclean shutdown internally
463
+ guard !isTestingNIOTS( ) else { return }
464
+
462
465
let httpBin = HttpBinForSSLUncleanShutdown ( )
463
466
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
464
467
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -476,6 +479,9 @@ class HTTPClientTests: XCTestCase {
476
479
}
477
480
478
481
func testNoContentLengthWithIgnoreErrorForSSLUncleanShutdown( ) throws {
482
+ // NIOTS deals with ssl unclean shutdown internally
483
+ guard !isTestingNIOTS( ) else { return }
484
+
479
485
let httpBin = HttpBinForSSLUncleanShutdown ( )
480
486
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
481
487
configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -494,6 +500,9 @@ class HTTPClientTests: XCTestCase {
494
500
}
495
501
496
502
func testCorrectContentLengthForSSLUncleanShutdown( ) throws {
503
+ // NIOTS deals with ssl unclean shutdown internally
504
+ guard !isTestingNIOTS( ) else { return }
505
+
497
506
let httpBin = HttpBinForSSLUncleanShutdown ( )
498
507
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
499
508
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -512,6 +521,9 @@ class HTTPClientTests: XCTestCase {
512
521
}
513
522
514
523
func testNoContentForSSLUncleanShutdown( ) throws {
524
+ // NIOTS deals with ssl unclean shutdown internally
525
+ guard !isTestingNIOTS( ) else { return }
526
+
515
527
let httpBin = HttpBinForSSLUncleanShutdown ( )
516
528
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
517
529
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -528,6 +540,9 @@ class HTTPClientTests: XCTestCase {
528
540
}
529
541
530
542
func testNoResponseForSSLUncleanShutdown( ) throws {
543
+ // NIOTS deals with ssl unclean shutdown internally
544
+ guard !isTestingNIOTS( ) else { return }
545
+
531
546
let httpBin = HttpBinForSSLUncleanShutdown ( )
532
547
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
533
548
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -545,6 +560,9 @@ class HTTPClientTests: XCTestCase {
545
560
}
546
561
547
562
func testNoResponseWithIgnoreErrorForSSLUncleanShutdown( ) throws {
563
+ // NIOTS deals with ssl unclean shutdown internally
564
+ guard !isTestingNIOTS( ) else { return }
565
+
548
566
let httpBin = HttpBinForSSLUncleanShutdown ( )
549
567
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
550
568
configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -562,6 +580,9 @@ class HTTPClientTests: XCTestCase {
562
580
}
563
581
564
582
func testWrongContentLengthForSSLUncleanShutdown( ) throws {
583
+ // NIOTS deals with ssl unclean shutdown internally
584
+ guard !isTestingNIOTS( ) else { return }
585
+
565
586
let httpBin = HttpBinForSSLUncleanShutdown ( )
566
587
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
567
588
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -579,6 +600,9 @@ class HTTPClientTests: XCTestCase {
579
600
}
580
601
581
602
func testWrongContentLengthWithIgnoreErrorForSSLUncleanShutdown( ) throws {
603
+ // NIOTS deals with ssl unclean shutdown internally
604
+ guard !isTestingNIOTS( ) else { return }
605
+
582
606
let httpBin = HttpBinForSSLUncleanShutdown ( )
583
607
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
584
608
configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -1663,18 +1687,16 @@ class HTTPClientTests: XCTestCase {
1663
1687
}
1664
1688
1665
1689
XCTAssertThrowsError ( try httpClient. get ( url: " http://localhost: \( port) " ) . wait ( ) ) { error in
1666
- #if canImport(Network)
1667
1690
if isTestingNIOTS ( ) {
1668
- guard let ioError = error as? NWPOSIXError , ioError. errorCode == . ECONNREFUSED else {
1691
+ guard case ChannelError . connectTimeout = error else {
1692
+ XCTFail ( " Unexpected error: \( error) " )
1693
+ return
1694
+ }
1695
+ } else {
1696
+ guard error is NIOConnectionError else {
1669
1697
XCTFail ( " Unexpected error: \( error) " )
1670
1698
return
1671
1699
}
1672
- return
1673
- }
1674
- #endif
1675
- guard error is NIOConnectionError else {
1676
- XCTFail ( " Unexpected error: \( error) " )
1677
- return
1678
1700
}
1679
1701
}
1680
1702
}
0 commit comments