Skip to content

Commit

Permalink
Remove deprecated TLSConfig.forClient() function
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Aug 12, 2021
1 parent 6fe49a0 commit 976a4b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Tests/MQTTNIOTests/MQTTNIOTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,11 @@ final class MQTTNIOTests: XCTestCase {
let rootCertificate = try NIOSSLCertificate.fromPEMFile(MQTTNIOTests.rootPath + "/mosquitto/certs/ca.crt")
let certificate = try NIOSSLCertificate.fromPEMFile(MQTTNIOTests.rootPath + "/mosquitto/certs/client.crt")
let privateKey = try NIOSSLPrivateKey(file: MQTTNIOTests.rootPath + "/mosquitto/certs/client.key", format: .pem)
let tlsConfiguration = TLSConfiguration.forClient(
trustRoots: .certificates(rootCertificate),
certificateChain: certificate.map { .certificate($0) },
privateKey: .privateKey(privateKey)
)
var tlsConfiguration = TLSConfiguration.makeClientConfiguration()
tlsConfiguration.trustRoots = .certificates(rootCertificate)
tlsConfiguration.certificateChain = certificate.map { .certificate($0) }
tlsConfiguration.privateKey = .privateKey(privateKey)

return .success(.niossl(tlsConfiguration))

#else
Expand Down

0 comments on commit 976a4b6

Please sign in to comment.