Skip to content

Commit 2738e18

Browse files
committed
fix: Honor VerifyCert setting
Signed-off-by: MarcWort <[email protected]>
1 parent c1422c1 commit 2738e18

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

collector/collector.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func NewSVCCollector(targets []utils.Target, tokenCaches map[string]*utils.AuthT
108108
UserName: t.Userid,
109109
Password: t.Password,
110110
IpAddress: t.IpAddress,
111+
VerifyCert: t.VerifyCert,
111112
AuthTokenCache: tokenCaches[t.IpAddress],
112113
AuthTokenMutex: tokenMutexes[t.IpAddress],
113114
ColCounter: colCounters[t.IpAddress],

collector_s/collector.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func NewSVCCollector(targets []utils.Target, tokenCaches map[string]*utils.AuthT
108108
UserName: t.Userid,
109109
Password: t.Password,
110110
IpAddress: t.IpAddress,
111+
VerifyCert: t.VerifyCert,
111112
AuthTokenCache: tokenCaches[t.IpAddress],
112113
AuthTokenMutex: tokenMutexes[t.IpAddress],
113114
ColCounter: colCounters[t.IpAddress],

utils/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ type Config struct {
2828
}
2929

3030
type Target struct {
31-
IpAddress string `yaml:"ipAddress"`
32-
Userid string `yaml:"userid"`
33-
Password string `yaml:"password"`
31+
IpAddress string `yaml:"ipAddress"`
32+
Userid string `yaml:"userid"`
33+
Password string `yaml:"password"`
34+
VerifyCert bool `yaml:"verifyCert"`
3435
}
3536

3637
type Label struct {

utils/spectrumClient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func (s *SpectrumClient) retrieveAuthToken() (authToken string, err error) {
165165
IdleConnTimeout: 90 * time.Second,
166166
TLSHandshakeTimeout: 10 * time.Second,
167167
ExpectContinueTimeout: 1 * time.Second,
168-
TLSClientConfig: &tls.Config{InsecureSkipVerify: false, MinVersion: tls.VersionTLS12},
168+
TLSClientConfig: &tls.Config{InsecureSkipVerify: s.VerifyCert, MinVersion: tls.VersionTLS12},
169169
},
170170
Timeout: 45 * time.Second,
171171
}

0 commit comments

Comments
 (0)