From 77616ab86005c9f02bc9ea935e81d488e921e7b8 Mon Sep 17 00:00:00 2001 From: Thomas Bartelmess Date: Mon, 4 Mar 2019 08:24:53 -0300 Subject: [PATCH] Renamed NIOOpenSSL->NIOSSL https://github.com/apple/swift-nio-ssl/pull/75 changed the name name of the NIOOpenSSL package to NIOSSL, as well as a changing the name of a bunch of classes and structs. This PR updates NIOPostgres to it can build against the master branch of swift-nio-ssl. --- Package.swift | 2 +- .../Connection/PostgresConnection+RequestTLS.swift | 6 ++++-- Sources/NIOPostgres/Utilities/Exports.swift | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index e6d67c70..1c722223 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( ], targets: [ .target(name: "CMD5", dependencies: []), - .target(name: "NIOPostgres", dependencies: ["CMD5", "NIO", "NIOOpenSSL"]), + .target(name: "NIOPostgres", dependencies: ["CMD5", "NIO", "NIOSSL"]), .target(name: "NIOPostgresBenchmark", dependencies: ["NIOPostgres"]), .testTarget(name: "NIOPostgresTests", dependencies: ["NIOPostgres"]), ] diff --git a/Sources/NIOPostgres/Connection/PostgresConnection+RequestTLS.swift b/Sources/NIOPostgres/Connection/PostgresConnection+RequestTLS.swift index 9e37ea98..0eac7161 100644 --- a/Sources/NIOPostgres/Connection/PostgresConnection+RequestTLS.swift +++ b/Sources/NIOPostgres/Connection/PostgresConnection+RequestTLS.swift @@ -1,10 +1,12 @@ +import NIOSSL + extension PostgresConnection { public func requestTLS(using tlsConfig: TLSConfiguration) -> EventLoopFuture { let tls = RequestTLSQuery() return self.send(tls).flatMapThrowing { _ in if tls.isSupported { - let sslContext = try SSLContext(configuration: tlsConfig) - let handler = try OpenSSLClientHandler(context: sslContext) + let sslContext = try NIOSSLContext(configuration: tlsConfig) + let handler = try NIOSSLClientHandler(context: sslContext) _ = self.channel.pipeline.addHandler(handler, position: .first) } return tls.isSupported diff --git a/Sources/NIOPostgres/Utilities/Exports.swift b/Sources/NIOPostgres/Utilities/Exports.swift index bb3fdbe1..62bbd42b 100644 --- a/Sources/NIOPostgres/Utilities/Exports.swift +++ b/Sources/NIOPostgres/Utilities/Exports.swift @@ -1,2 +1,2 @@ @_exported import NIO -@_exported import NIOOpenSSL +@_exported import NIOSSL