diff --git a/Tests/AsyncHTTPClientTests/AsyncAwaitEndToEndTests.swift b/Tests/AsyncHTTPClientTests/AsyncAwaitEndToEndTests.swift index 626f5b4ae..524fc6e07 100644 --- a/Tests/AsyncHTTPClientTests/AsyncAwaitEndToEndTests.swift +++ b/Tests/AsyncHTTPClientTests/AsyncAwaitEndToEndTests.swift @@ -527,9 +527,10 @@ final class AsyncAwaitEndToEndTests: XCTestCase { /// openssl req -x509 -newkey rsa:4096 -keyout self_signed_key.pem -out self_signed_cert.pem -sha256 -days 99999 -nodes -subj '/CN=localhost' let certPath = Bundle.module.path(forResource: "self_signed_cert", ofType: "pem")! let keyPath = Bundle.module.path(forResource: "self_signed_key", ofType: "pem")! + let key = try NIOSSLPrivateKey(file: keyPath, format: .pem) let configuration = TLSConfiguration.makeServerConfiguration( certificateChain: try NIOSSLCertificate.fromPEMFile(certPath).map { .certificate($0) }, - privateKey: .file(keyPath) + privateKey: .privateKey(key) ) let sslContext = try NIOSSLContext(configuration: configuration) let serverGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1) @@ -597,10 +598,11 @@ final class AsyncAwaitEndToEndTests: XCTestCase { /// ``` let certPath = Bundle.module.path(forResource: "example.com.cert", ofType: "pem")! let keyPath = Bundle.module.path(forResource: "example.com.private-key", ofType: "pem")! + let key = try NIOSSLPrivateKey(file: keyPath, format: .pem) let localhostCert = try NIOSSLCertificate.fromPEMFile(certPath) let configuration = TLSConfiguration.makeServerConfiguration( certificateChain: localhostCert.map { .certificate($0) }, - privateKey: .file(keyPath) + privateKey: .privateKey(key) ) let bin = HTTPBin(.http2(tlsConfiguration: configuration)) defer { XCTAssertNoThrow(try bin.shutdown()) } diff --git a/Tests/AsyncHTTPClientTests/HTTPClientTests.swift b/Tests/AsyncHTTPClientTests/HTTPClientTests.swift index 2a30a07ca..ac0aee068 100644 --- a/Tests/AsyncHTTPClientTests/HTTPClientTests.swift +++ b/Tests/AsyncHTTPClientTests/HTTPClientTests.swift @@ -1274,9 +1274,10 @@ final class HTTPClientTests: XCTestCaseHTTPClientTestsBaseClass { /// openssl req -x509 -newkey rsa:4096 -keyout self_signed_key.pem -out self_signed_cert.pem -sha256 -days 99999 -nodes -subj '/CN=localhost' let certPath = Bundle.module.path(forResource: "self_signed_cert", ofType: "pem")! let keyPath = Bundle.module.path(forResource: "self_signed_key", ofType: "pem")! + let key = try NIOSSLPrivateKey(file: keyPath, format: .pem) let configuration = try TLSConfiguration.makeServerConfiguration( certificateChain: NIOSSLCertificate.fromPEMFile(certPath).map { .certificate($0) }, - privateKey: .file(keyPath) + privateKey: .privateKey(key) ) let sslContext = try NIOSSLContext(configuration: configuration) @@ -1314,9 +1315,10 @@ final class HTTPClientTests: XCTestCaseHTTPClientTestsBaseClass { /// openssl req -x509 -newkey rsa:4096 -keyout self_signed_key.pem -out self_signed_cert.pem -sha256 -days 99999 -nodes -subj '/CN=localhost' let certPath = Bundle.module.path(forResource: "self_signed_cert", ofType: "pem")! let keyPath = Bundle.module.path(forResource: "self_signed_key", ofType: "pem")! + let key = try NIOSSLPrivateKey(file: keyPath, format: .pem) let configuration = try TLSConfiguration.makeServerConfiguration( certificateChain: NIOSSLCertificate.fromPEMFile(certPath).map { .certificate($0) }, - privateKey: .file(keyPath) + privateKey: .privateKey(key) ) let sslContext = try NIOSSLContext(configuration: configuration)