mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Add new SSL config to envvar parsing
This commit is contained in:
parent
1c32ce5945
commit
f911070f68
12
conn.go
12
conn.go
@ -827,6 +827,9 @@ func ParseConnectionString(s string) (ConnConfig, error) {
|
|||||||
// PGUSER
|
// PGUSER
|
||||||
// PGPASSWORD
|
// PGPASSWORD
|
||||||
// PGSSLMODE
|
// PGSSLMODE
|
||||||
|
// PGSSLCERT
|
||||||
|
// PGSSLKEY
|
||||||
|
// PGSSLROOTCERT
|
||||||
// PGAPPNAME
|
// PGAPPNAME
|
||||||
// PGCONNECT_TIMEOUT
|
// PGCONNECT_TIMEOUT
|
||||||
//
|
//
|
||||||
@ -874,9 +877,14 @@ func ParseEnvLibpq() (ConnConfig, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sslmode := os.Getenv("PGSSLMODE")
|
tlsArgs := configTLSArgs{
|
||||||
|
sslMode: os.Getenv("PGSSLMODE"),
|
||||||
|
sslKey: os.Getenv("PGSSLKEY"),
|
||||||
|
sslCert: os.Getenv("PGSSLCERT"),
|
||||||
|
sslRootCert: os.Getenv("PGSSLROOTCERT"),
|
||||||
|
}
|
||||||
|
|
||||||
err := configTLS(configTLSArgs{sslMode: sslmode}, &cc)
|
err := configTLS(tlsArgs, &cc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cc, err
|
return cc, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user