Implement DANE verification option

This commit is contained in:
Rob Best
2020-11-01 14:24:44 +00:00
parent e05745b959
commit 50ab336c98
297 changed files with 39598 additions and 469 deletions
+1 -8
View File
@@ -12,12 +12,10 @@ import (
"github.com/prometheus/common/log"
"github.com/ribbybibby/ssl_exporter/config"
pconfig "github.com/prometheus/common/config"
)
// ProbeHTTPS performs a https probe
func ProbeHTTPS(target string, module config.Module, timeout time.Duration) (*tls.ConnectionState, error) {
func ProbeHTTPS(target string, module config.Module, timeout time.Duration, tlsConfig *tls.Config) (*tls.ConnectionState, error) {
if strings.HasPrefix(target, "http://") {
return nil, fmt.Errorf("Target is using http scheme: %s", target)
}
@@ -31,11 +29,6 @@ func ProbeHTTPS(target string, module config.Module, timeout time.Duration) (*tl
return nil, err
}
tlsConfig, err := pconfig.NewTLSConfig(&module.TLSConfig)
if err != nil {
return nil, err
}
proxy := http.ProxyFromEnvironment
if module.HTTPS.ProxyURL.URL != nil {
proxy = http.ProxyURL(module.HTTPS.ProxyURL.URL)