Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 2c36ce0

Browse files
committed
common: Only allow skipping the backend DB cert check in non-prod environments
1 parent 45ac5b8 commit 2c36ce0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

common/config.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,12 @@ func ReadConfig() error {
169169
pgConfig.User = Conf.Pg.Username
170170
pgConfig.Password = Conf.Pg.Password
171171
pgConfig.Database = Conf.Pg.Database
172-
clientTLSConfig := tls.Config{InsecureSkipVerify: true}
172+
clientTLSConfig := tls.Config{}
173+
if Conf.Environment.Environment == "production" {
174+
clientTLSConfig.InsecureSkipVerify = false
175+
} else {
176+
clientTLSConfig.InsecureSkipVerify = true
177+
}
173178
if Conf.Pg.SSL {
174179
pgConfig.TLSConfig = &clientTLSConfig
175180
} else {

0 commit comments

Comments
 (0)