Add stordb pgSSLCertMode option

This commit is contained in:
ionutboangiu
2024-08-09 20:15:35 +03:00
committed by Dan Christian Bogos
parent 9a79b092a5
commit 73fc386036
11 changed files with 51 additions and 21 deletions

View File

@@ -29,7 +29,7 @@ import (
// NewPostgresStorage returns the posgres storDB
func NewPostgresStorage(host, port, name, user, password, pgSchema,
sslmode, sslcert, sslkey, sslpassword, sslrootcert string,
sslmode, sslcert, sslkey, sslpassword, sslcertmode, sslrootcert string,
maxConn, maxIdleConn int, connMaxLifetime time.Duration) (*SQLStorage, error) {
connStr := fmt.Sprintf(
"host=%s port=%s dbname=%s user=%s password=%s sslmode=%s",
@@ -43,6 +43,9 @@ func NewPostgresStorage(host, port, name, user, password, pgSchema,
if sslpassword != "" {
connStr = connStr + " sslpassword=" + sslpassword
}
if sslcertmode != "" {
connStr = connStr + " sslcertmode=" + sslcertmode
}
if sslrootcert != "" {
connStr = connStr + " sslrootcert=" + sslrootcert
}