diff --git a/internal/config/config.go b/internal/config/config.go index 2f7c0979fe..c5dd20195e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -422,7 +422,7 @@ func handleSelfSignedCertificates(col *Collector) error { } func processOtlpReceivers(tlsConfig *OtlpTLSConfig) error { - sanNames := []string{"127.0.0.1", "::1", "localhost"} + sanNames := strings.Split(DefCollectorTLSSANNames, ",") if tlsConfig.Ca == "" { tlsConfig.Ca = DefCollectorTLSCAPath diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 1be57d62cb..40030c5020 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -22,6 +22,7 @@ const ( DefCollectorTLSCertPath = "/var/lib/nginx-agent/cert.pem" DefCollectorTLSKeyPath = "/var/lib/nginx-agent/key.pem" DefCollectorTLSCAPath = "/var/lib/nginx-agent/ca.pem" + DefCollectorTLSSANNames = "127.0.0.1, ::1, localhost" DefCommandServerHostKey = "" DefCommandServerPortKey = 0