Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTim committed Jun 5, 2023
2 parents 7665de8 + 4f55dd2 commit 0a9648f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
11 changes: 8 additions & 3 deletions docs/deploy/heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,14 @@ The Heroku Postgres addon [requires](https://devcenter.heroku.com/changelog-item
The following snippet shows how to achieve both:

```swift
if let databaseURL = Environment.get("DATABASE_URL"), var postgresConfig = PostgresConfiguration(url: databaseURL) {
postgresConfig.tlsConfiguration = .makeClientConfiguration()
postgresConfig.tlsConfiguration?.certificateVerification = .none
if let databaseURL = Environment.get("DATABASE_URL") {
var tlsConfig: TLSConfiguration = .makeClientConfiguration()
tlsConfig.certificateVerification = .none
let nioSSLContext = try NIOSSLContext(configuration: tlsConfig)

var postgresConfig = try SQLPostgresConfiguration(url: databaseURL)
postgresConfig.coreConfiguration.tls = .require(nioSSLContext)

app.databases.use(.postgres(configuration: postgresConfig), as: .psql)
} else {
// ...
Expand Down
11 changes: 8 additions & 3 deletions docs/deploy/heroku.nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,14 @@ De Heroku Postgres addon [vereist](https://devcenter.heroku.com/changelog-items/
Het volgende fragment laat zien hoe beide bereikt kunnen worden:

```swift
if let databaseURL = Environment.get("DATABASE_URL"), var postgresConfig = PostgresConfiguration(url: databaseURL) {
postgresConfig.tlsConfiguration = .makeClientConfiguration()
postgresConfig.tlsConfiguration?.certificateVerification = .none
if let databaseURL = Environment.get("DATABASE_URL") {
var tlsConfig: TLSConfiguration = .makeClientConfiguration()
tlsConfig.certificateVerification = .none
let nioSSLContext = try NIOSSLContext(configuration: tlsConfig)

var postgresConfig = try SQLPostgresConfiguration(url: databaseURL)
postgresConfig.coreConfiguration.tls = .require(nioSSLContext)

app.databases.use(.postgres(configuration: postgresConfig), as: .psql)
} else {
// ...
Expand Down
11 changes: 8 additions & 3 deletions docs/deploy/heroku.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,14 @@ DATABASE_URL: postgres://cybntsgadydqzm:2d9dc7f6d964f4750da1518ad71hag2ba729cd45

```swift
if let databaseURL = Environment.get("DATABASE_URL") {
app.databases.use(try .postgres(
url: databaseURL
), as: .psql)
var tlsConfig: TLSConfiguration = .makeClientConfiguration()
tlsConfig.certificateVerification = .none
let nioSSLContext = try NIOSSLContext(configuration: tlsConfig)

var postgresConfig = try SQLPostgresConfiguration(url: databaseURL)
postgresConfig.coreConfiguration.tls = .require(nioSSLContext)

app.databases.use(.postgres(configuration: postgresConfig), as: .psql)
} else {
// ...
}
Expand Down

0 comments on commit 0a9648f

Please sign in to comment.