Skip to content

Commit

Permalink
Add support for setting server_name as query parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
johanfleury committed Oct 8, 2021
1 parent 78306b9 commit a7eef4d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ssl_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ func probeHandler(logger log.Logger, w http.ResponseWriter, r *http.Request, con
return
}

if serverName := r.URL.Query().Get("server_name"); serverName != "" {
level.Debug(logger).Log("msg", fmt.Sprintf("Using %s as server name", serverName))
logger = log.With(logger, "server_name", serverName)
module.TLSConfig.ServerName = serverName
}

timeout := module.Timeout
if timeout == 0 {
// The following timeout block was taken wholly from the blackbox exporter
Expand Down

0 comments on commit a7eef4d

Please sign in to comment.