@@ -527,9 +527,10 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
527527 /// openssl req -x509 -newkey rsa:4096 -keyout self_signed_key.pem -out self_signed_cert.pem -sha256 -days 99999 -nodes -subj '/CN=localhost'
528528 let certPath = Bundle . module. path ( forResource: " self_signed_cert " , ofType: " pem " ) !
529529 let keyPath = Bundle . module. path ( forResource: " self_signed_key " , ofType: " pem " ) !
530+ let key = try NIOSSLPrivateKey ( file: keyPath, format: . pem)
530531 let configuration = TLSConfiguration . makeServerConfiguration (
531532 certificateChain: try NIOSSLCertificate . fromPEMFile ( certPath) . map { . certificate( $0) } ,
532- privateKey: . file ( keyPath )
533+ privateKey: . privateKey ( key )
533534 )
534535 let sslContext = try NIOSSLContext ( configuration: configuration)
535536 let serverGroup = MultiThreadedEventLoopGroup ( numberOfThreads: 1 )
@@ -597,10 +598,11 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
597598 /// ```
598599 let certPath = Bundle . module. path ( forResource: " example.com.cert " , ofType: " pem " ) !
599600 let keyPath = Bundle . module. path ( forResource: " example.com.private-key " , ofType: " pem " ) !
601+ let key = try NIOSSLPrivateKey ( file: keyPath, format: . pem)
600602 let localhostCert = try NIOSSLCertificate . fromPEMFile ( certPath)
601603 let configuration = TLSConfiguration . makeServerConfiguration (
602604 certificateChain: localhostCert. map { . certificate( $0) } ,
603- privateKey: . file ( keyPath )
605+ privateKey: . privateKey ( key )
604606 )
605607 let bin = HTTPBin ( . http2( tlsConfiguration: configuration) )
606608 defer { XCTAssertNoThrow ( try bin. shutdown ( ) ) }
0 commit comments