Skip to content

Commit

Permalink
Change default sslMode to "prefer"
Browse files Browse the repository at this point in the history
  • Loading branch information
Tvion committed Jan 13, 2025
1 parent 370d84e commit b6fdf4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion collector/pkg/metrics/ura_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func handleSourceOfMetric(s *Scraper, parameters map[string]interface{}, paramTy
}

func parseSSLMode(url string) string {
if util.GetEnv("PGSSLMODE", "disable") == "require" {
if util.GetEnv("PGSSLMODE", "prefer") == "require" {
return strings.Replace(url, "http", "https", -1)
}
return url
Expand Down
4 changes: 2 additions & 2 deletions collector/pkg/postgres/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
PgUser = util.GetEnv("MONITORING_USER", "monitoring_role")
PgPass = util.GetEnv("MONITORING_PASSWORD", "monitoring_password")
PgDatabase = util.GetEnv("POSTGRES_DATABASE", "postgres")
PgSsl = util.GetEnv("PGSSLMODE", "disable")
PgSsl = util.GetEnv("PGSSLMODE", "prefer")
)

type Row map[string]interface{}
Expand All @@ -57,7 +57,7 @@ func NewConnector() *PostgresConnector {
func NewConnectorForUser(host string, port int, user, pass string) *PostgresConnector {

ssl := false
if PgSsl != "disable" {
if PgSsl == "require" {
ssl = true
}

Expand Down

0 comments on commit b6fdf4e

Please sign in to comment.