We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb6e8a9 commit 4d6b9bbCopy full SHA for 4d6b9bb
Sources/PostgresKit/PostgresConfiguration.swift
@@ -13,7 +13,7 @@ public struct PostgresConfiguration {
13
internal var _hostname: String?
14
15
public init?(url: URL) {
16
- guard url.scheme == "postgres" else {
+ guard url.scheme?.hasPrefix("postgres") == true else {
17
return nil
18
}
19
guard let username = url.user else {
@@ -30,8 +30,8 @@ public struct PostgresConfiguration {
30
31
32
let tlsConfiguration: TLSConfiguration?
33
- if url.query == "ssl=true" {
34
- tlsConfiguration = TLSConfiguration.forClient(certificateVerification: .none)
+ if url.query?.contains("ssl=true") == true || url.query?.contains("sslmode=require") == true {
+ tlsConfiguration = TLSConfiguration.forClient()
35
} else {
36
tlsConfiguration = nil
37
0 commit comments