Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import NIOSSL

extension PostgresConnection {
public func requestTLS(using tlsConfig: TLSConfiguration) -> EventLoopFuture<Bool> {
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
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOPostgres/Utilities/Exports.swift
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@_exported import NIO
@_exported import NIOOpenSSL
@_exported import NIOSSL