connect with SSL

This commit is contained in:
Andre Medeiros 2021-07-13 09:24:31 -04:00
parent 245c56eae0
commit 49a89d3674
2 changed files with 4 additions and 2 deletions

View file

@ -58,7 +58,8 @@ func main() {
// Set up Postgres connection
var pool *pgxpool.Pool
{
config, err := pgxpool.ParseConfig(os.Getenv("DATABASE_CONNECTION_POOL_URL"))
url := fmt.Sprintf("%s?sslmode=require", os.Getenv("DATABASE_CONNECTION_POOL_URL"))
config, err := pgxpool.ParseConfig(url)
if err != nil {
panic(err)
}

View file

@ -56,7 +56,8 @@ func main() {
// Set up Postgres connection
var pool *pgxpool.Pool
{
config, err := pgxpool.ParseConfig(os.Getenv("DATABASE_CONNECTION_POOL_URL"))
url := fmt.Sprintf("%s?sslmode=require", os.Getenv("DATABASE_CONNECTION_POOL_URL"))
config, err := pgxpool.ParseConfig(url)
if err != nil {
panic(err)
}