diff --git a/changelog/unreleased/make-insecureskipverify-configurable.md b/changelog/unreleased/make-insecureskipverify-configurable.md new file mode 100644 index 0000000000..4fbdfd800f --- /dev/null +++ b/changelog/unreleased/make-insecureskipverify-configurable.md @@ -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 diff --git a/examples/metrics/xcloud.toml b/examples/metrics/xcloud.toml index 95b0d1b4d8..d055bcfe75 100644 --- a/examples/metrics/xcloud.toml +++ b/examples/metrics/xcloud.toml @@ -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] diff --git a/pkg/metrics/config/config.go b/pkg/metrics/config/config.go index 424e5e1659..c0447b44ce 100644 --- a/pkg/metrics/config/config.go +++ b/pkg/metrics/config/config.go @@ -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 diff --git a/pkg/metrics/driver/xcloud/xcloud.go b/pkg/metrics/driver/xcloud/xcloud.go index 9855b3f88d..51e410df96 100644 --- a/pkg/metrics/driver/xcloud/xcloud.go +++ b/pkg/metrics/driver/xcloud/xcloud.go @@ -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}