Skip to content

Commit

Permalink
xcloud: make InsecureSkipVerify configurable (#1589)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-sturbia authored Mar 26, 2021
1 parent fb410ea commit 23edd54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/make-insecureskipverify-configurable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Make InsecureSkipVerify configurable

Add `InsecureSkipVerify` field to `metrics.Config` struct and update examples
to include it.

https://github.com/cs3org/reva/issues/1411
1 change: 1 addition & 0 deletions examples/metrics/xcloud.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ metrics_record_interval = 5000
xcloud_instance = "http://localhost"
xcloud_interval = 5
xcloud_catalog = 'https://sciencemesh-test.uni-muenster.de/api/mentix/sites?action=register'
insecure_skip_verify = true

[http.services.prometheus]
1 change: 1 addition & 0 deletions pkg/metrics/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Config struct {
XcloudInstance string `mapstructure:"xcloud_instance"`
XcloudCatalog string `mapstructure:"xcloud_catalog"`
XcloudPullInterval int `mapstructure:"xcloud_pull_interval"`
InsecureSkipVerify bool `mapstructure:"insecure_skip_verify"`
}

// Init sets sane defaults
Expand Down
3 changes: 1 addition & 2 deletions pkg/metrics/driver/xcloud/xcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ func (d *CloudDriver) Configure(c *config.Config) error {
d.pullInterval = c.XcloudPullInterval
d.catalog = c.XcloudCatalog

// TODO(labkode): make it configurable once site adopted are prod-ready
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSClientConfig: &tls.Config{InsecureSkipVerify: c.InsecureSkipVerify},
}
client := &http.Client{Transport: tr}

Expand Down

0 comments on commit 23edd54

Please sign in to comment.