mirror of
https://github.com/ribbybibby/ssl_exporter.git
synced 2026-08-26 02:57:19 +00:00
Implement DANE verification option
This commit is contained in:
+1
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user