@@ -471,6 +471,9 @@ class HTTPClientTests: XCTestCase {
471
471
}
472
472
473
473
func testNoContentLengthForSSLUncleanShutdown( ) throws {
474
+ // NIOTS deals with ssl unclean shutdown internally
475
+ guard !isTestingNIOTS( ) else { return }
476
+
474
477
let httpBin = HttpBinForSSLUncleanShutdown ( )
475
478
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
476
479
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -488,6 +491,9 @@ class HTTPClientTests: XCTestCase {
488
491
}
489
492
490
493
func testNoContentLengthWithIgnoreErrorForSSLUncleanShutdown( ) throws {
494
+ // NIOTS deals with ssl unclean shutdown internally
495
+ guard !isTestingNIOTS( ) else { return }
496
+
491
497
let httpBin = HttpBinForSSLUncleanShutdown ( )
492
498
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
493
499
configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -506,6 +512,9 @@ class HTTPClientTests: XCTestCase {
506
512
}
507
513
508
514
func testCorrectContentLengthForSSLUncleanShutdown( ) throws {
515
+ // NIOTS deals with ssl unclean shutdown internally
516
+ guard !isTestingNIOTS( ) else { return }
517
+
509
518
let httpBin = HttpBinForSSLUncleanShutdown ( )
510
519
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
511
520
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -524,6 +533,9 @@ class HTTPClientTests: XCTestCase {
524
533
}
525
534
526
535
func testNoContentForSSLUncleanShutdown( ) throws {
536
+ // NIOTS deals with ssl unclean shutdown internally
537
+ guard !isTestingNIOTS( ) else { return }
538
+
527
539
let httpBin = HttpBinForSSLUncleanShutdown ( )
528
540
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
529
541
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -540,6 +552,9 @@ class HTTPClientTests: XCTestCase {
540
552
}
541
553
542
554
func testNoResponseForSSLUncleanShutdown( ) throws {
555
+ // NIOTS deals with ssl unclean shutdown internally
556
+ guard !isTestingNIOTS( ) else { return }
557
+
543
558
let httpBin = HttpBinForSSLUncleanShutdown ( )
544
559
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
545
560
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -557,6 +572,9 @@ class HTTPClientTests: XCTestCase {
557
572
}
558
573
559
574
func testNoResponseWithIgnoreErrorForSSLUncleanShutdown( ) throws {
575
+ // NIOTS deals with ssl unclean shutdown internally
576
+ guard !isTestingNIOTS( ) else { return }
577
+
560
578
let httpBin = HttpBinForSSLUncleanShutdown ( )
561
579
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
562
580
configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -574,6 +592,9 @@ class HTTPClientTests: XCTestCase {
574
592
}
575
593
576
594
func testWrongContentLengthForSSLUncleanShutdown( ) throws {
595
+ // NIOTS deals with ssl unclean shutdown internally
596
+ guard !isTestingNIOTS( ) else { return }
597
+
577
598
let httpBin = HttpBinForSSLUncleanShutdown ( )
578
599
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
579
600
configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -591,6 +612,9 @@ class HTTPClientTests: XCTestCase {
591
612
}
592
613
593
614
func testWrongContentLengthWithIgnoreErrorForSSLUncleanShutdown( ) throws {
615
+ // NIOTS deals with ssl unclean shutdown internally
616
+ guard !isTestingNIOTS( ) else { return }
617
+
594
618
let httpBin = HttpBinForSSLUncleanShutdown ( )
595
619
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
596
620
configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -1675,18 +1699,16 @@ class HTTPClientTests: XCTestCase {
1675
1699
}
1676
1700
1677
1701
XCTAssertThrowsError ( try httpClient. get ( url: " http://localhost: \( port) " ) . wait ( ) ) { error in
1678
- #if canImport(Network)
1679
1702
if isTestingNIOTS ( ) {
1680
- guard let ioError = error as? NWPOSIXError , ioError. errorCode == . ECONNREFUSED else {
1703
+ guard case ChannelError . connectTimeout = error else {
1704
+ XCTFail ( " Unexpected error: \( error) " )
1705
+ return
1706
+ }
1707
+ } else {
1708
+ guard error is NIOConnectionError else {
1681
1709
XCTFail ( " Unexpected error: \( error) " )
1682
1710
return
1683
1711
}
1684
- return
1685
- }
1686
- #endif
1687
- guard error is NIOConnectionError else {
1688
- XCTFail ( " Unexpected error: \( error) " )
1689
- return
1690
1712
}
1691
1713
}
1692
1714
}
0 commit comments