Skip to content

Commit

Permalink
Fix NIOSSL deprecation warnings
Browse files Browse the repository at this point in the history
- Package.swift had the `NIOSSL` package raised to 2.14.1 from the previous 2.12.0.
- All instances of `TLSConfiguration.forClient` have been replaced with `TLSConfiguration.makeClientConfiguration`

Co-authored-by: Fabian Fett <fabianfett@apple.com>
  • Loading branch information
jareyesda and fabianfett authored Aug 18, 2021
1 parent 08c0dc5 commit 6a9eb6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.12.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.14.1"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-metrics.git", from: "2.0.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.0"),
Expand Down
4 changes: 2 additions & 2 deletions Tests/IntegrationTests/PostgresNIOTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ final class PostgresNIOTests: XCTestCase {
var conn: PostgresConnection?
XCTAssertNoThrow(conn = try PostgresConnection.connect(
to: SocketAddress.makeAddressResolvingHost("elmer.db.elephantsql.com", port: 5432),
tlsConfiguration: .forClient(certificateVerification: .none),
tlsConfiguration: .makeClientConfiguration(),
serverHostname: "elmer.db.elephantsql.com",
on: eventLoop
).wait())
Expand Down Expand Up @@ -709,7 +709,7 @@ final class PostgresNIOTests: XCTestCase {
XCTAssertThrowsError(
try PostgresConnection.connect(
to: SocketAddress.makeAddressResolvingHost("elmer.db.elephantsql.com", port: 5432),
tlsConfiguration: .forClient(certificateVerification: .fullVerification),
tlsConfiguration: .makeClientConfiguration(),
serverHostname: "34.228.73.168",
on: eventLoop
).wait()
Expand Down
4 changes: 2 additions & 2 deletions Tests/PostgresNIOTests/New/PSQLChannelHandlerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PSQLChannelHandlerTests: XCTestCase {

func testEstablishSSLCallbackIsCalledIfSSLIsSupported() {
var config = self.testConnectionConfiguration()
config.tlsConfiguration = .forClient(certificateVerification: .none)
config.tlsConfiguration = .makeClientConfiguration()
var addSSLCallbackIsHit = false
let handler = PSQLChannelHandler(authentification: config.authentication) { channel in
addSSLCallbackIsHit = true
Expand Down Expand Up @@ -72,7 +72,7 @@ class PSQLChannelHandlerTests: XCTestCase {

func testSSLUnsupportedClosesConnection() {
var config = self.testConnectionConfiguration()
config.tlsConfiguration = .forClient()
config.tlsConfiguration = .makeClientConfiguration()

let handler = PSQLChannelHandler(authentification: config.authentication) { channel in
XCTFail("This callback should never be exectuded")
Expand Down

0 comments on commit 6a9eb6f

Please sign in to comment.