@@ -527,9 +527,10 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
527
527
/// openssl req -x509 -newkey rsa:4096 -keyout self_signed_key.pem -out self_signed_cert.pem -sha256 -days 99999 -nodes -subj '/CN=localhost'
528
528
let certPath = Bundle . module. path ( forResource: " self_signed_cert " , ofType: " pem " ) !
529
529
let keyPath = Bundle . module. path ( forResource: " self_signed_key " , ofType: " pem " ) !
530
+ let key = try NIOSSLPrivateKey ( file: keyPath, format: . pem)
530
531
let configuration = TLSConfiguration . makeServerConfiguration (
531
532
certificateChain: try NIOSSLCertificate . fromPEMFile ( certPath) . map { . certificate( $0) } ,
532
- privateKey: . file ( keyPath )
533
+ privateKey: . privateKey ( key )
533
534
)
534
535
let sslContext = try NIOSSLContext ( configuration: configuration)
535
536
let serverGroup = MultiThreadedEventLoopGroup ( numberOfThreads: 1 )
@@ -597,10 +598,11 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
597
598
/// ```
598
599
let certPath = Bundle . module. path ( forResource: " example.com.cert " , ofType: " pem " ) !
599
600
let keyPath = Bundle . module. path ( forResource: " example.com.private-key " , ofType: " pem " ) !
601
+ let key = try NIOSSLPrivateKey ( file: keyPath, format: . pem)
600
602
let localhostCert = try NIOSSLCertificate . fromPEMFile ( certPath)
601
603
let configuration = TLSConfiguration . makeServerConfiguration (
602
604
certificateChain: localhostCert. map { . certificate( $0) } ,
603
- privateKey: . file ( keyPath )
605
+ privateKey: . privateKey ( key )
604
606
)
605
607
let bin = HTTPBin ( . http2( tlsConfiguration: configuration) )
606
608
defer { XCTAssertNoThrow ( try bin. shutdown ( ) ) }
0 commit comments