@@ -13,8 +13,8 @@ class PostgreSQLConnectionTests: XCTestCase {
13
13
try XCTAssert ( results [ 0 ] . firstValue ( forColumn: " version " ) ? . decode ( String . self) . contains ( " 10. " ) == true )
14
14
}
15
15
16
- func testSSLConnection ( ) throws {
17
- let client = try PostgreSQLConnection . makeTest ( tlsConfiguration : . forClient ( certificateVerification : . none ) )
16
+ func testUnverifiedSSLConnection ( ) throws {
17
+ let client = try PostgreSQLConnection . makeTest ( transportConfig : . unverifiedTLS )
18
18
let results = try client. simpleQuery ( " SELECT version(); " ) . wait ( )
19
19
try XCTAssert ( results [ 0 ] . firstValue ( forColumn: " version " ) ? . decode ( String . self) . contains ( " 10. " ) == true )
20
20
}
@@ -441,7 +441,7 @@ class PostgreSQLConnectionTests: XCTestCase {
441
441
}
442
442
443
443
static var allTests = [
444
- ( " testSSLConnection " , testSSLConnection ) ,
444
+ ( " testUnverifiedSSLConnection " , testUnverifiedSSLConnection ) ,
445
445
( " testVersion " , testVersion) ,
446
446
( " testSelectTypes " , testSelectTypes) ,
447
447
( " testParse " , testParse) ,
@@ -459,7 +459,7 @@ class PostgreSQLConnectionTests: XCTestCase {
459
459
460
460
extension PostgreSQLConnection {
461
461
/// Creates a test event loop and psql client.
462
- static func makeTest( tlsConfiguration : TLSConfiguration ? = nil ) throws -> PostgreSQLConnection {
462
+ static func makeTest( transportConfig : PostgreSQLTransportConfig ? = nil ) throws -> PostgreSQLConnection {
463
463
let hostname : String
464
464
#if Xcode
465
465
hostname = ( try ? Process . execute ( " docker-machine " , " ip " ) ) ?? " 192.168.99.100 "
@@ -469,8 +469,8 @@ extension PostgreSQLConnection {
469
469
let group = MultiThreadedEventLoopGroup ( numThreads: 1 )
470
470
var client : PostgreSQLConnection
471
471
472
- if let tlsConfiguration = tlsConfiguration {
473
- client = try PostgreSQLConnection . connect ( hostname: hostname, port: 5433 , tlsConfiguration : tlsConfiguration , on: group) { error in
472
+ if let transportConfig = transportConfig {
473
+ client = try PostgreSQLConnection . connect ( hostname: hostname, port: 5433 , transportConfig : transportConfig , on: group) { error in
474
474
XCTFail ( " \( error) " )
475
475
} . wait ( )
476
476
} else {
0 commit comments