Skip to content

Commit

Permalink
Replace IPv6 unspecified address for watchdog health checks
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSerth committed Apr 2, 2024
1 parent 8bcf437 commit 39d25d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/poseidon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"net/http"
"os"
"os/signal"
"regexp"
"runtime"
"runtime/debug"
"runtime/pprof"
Expand Down Expand Up @@ -257,7 +258,10 @@ func systemdWatchdogLoop(ctx context.Context, router *mux.Router, interval time.
return
}
healthURL := config.Config.Server.URL().String() + healthRoute.String()
healthURL = strings.ReplaceAll(healthURL, "0.0.0.0", "localhost") // Workaround for certificate subject names

// Workaround for certificate subject names
unspecifiedAddresses := regexp.MustCompile(`0\.0\.0\.0|\[::]`)
healthURL = unspecifiedAddresses.ReplaceAllString(healthURL, "localhost")

client := &http.Client{}
if config.Config.Server.TLS.Active {
Expand Down

0 comments on commit 39d25d2

Please sign in to comment.