mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:17:32 +00:00
fix: Secure sql connection (#332)
* feat: sql ssl connection * fix: simpler implementation of ssl-config in sql * fix(config): set db ssl connection by env vars
This commit is contained in:
@@ -2,6 +2,7 @@ package repository
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/caos/zitadel/internal/config/types"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/jinzhu/gorm"
|
||||
@@ -12,7 +13,7 @@ type ViewConfig struct {
|
||||
}
|
||||
|
||||
func Start(conf ViewConfig) (*sql.DB, *gorm.DB, error) {
|
||||
sqlClient, err := sql.Open("postgres", conf.SQL.ConnectionString())
|
||||
sqlClient, err := conf.SQL.Start()
|
||||
if err != nil {
|
||||
return nil, nil, errors.ThrowPreconditionFailed(err, "SQL-9qBtr", "unable to open database connection")
|
||||
}
|
||||
|
Reference in New Issue
Block a user