3

I am trying to deploy postgres in Digital Ocean. After setting up the Managed databases, it provided ca-certificate.crt which needs to be installed on the backend app. Tech stack

  • Vapor for backend dev
  • DO for server

As per DO, they said to refer the docs of Vapor how to install it. Unfortunately, Vapor has no documentation yet on how to install it. https://docs.vapor.codes/4.0/fluent/overview/

How can I install .crt file on vapor project to test if SSL is working or not. It helps me to connect with DB on DO. Any help is appreciated.

So far my code doesn't have any TLS configuration, I can add TLS config only after the crt is where to install correctly.

 app.databases.use(.postgres(
                        example",
                        port: 25060,
                        username: "example",
                        password: "example",
                        database: "exampledb"),
                      as: .psql)
user4150758
  • 384
  • 4
  • 17

1 Answers1

4

One of the parameters the .postgres function takes is a TLSConfiguration. You can use this to set up the certificate needed

0xTim
  • 5,146
  • 11
  • 23