|
|
|
@ -226,7 +226,7 @@ func (o *clientOptions) getTransport(endpoint string) (tr http.RoundTripper, err
|
|
|
|
|
return tr, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// WithTransport adds a custom transport to the Client. It will fail if a
|
|
|
|
|
// WithTransport adds a custom transport to the Client. It will fail if a
|
|
|
|
|
// previous option to create the transport has been configured.
|
|
|
|
|
func WithTransport(tr http.RoundTripper) ClientOption {
|
|
|
|
|
return func(o *clientOptions) error {
|
|
|
|
@ -238,6 +238,17 @@ func WithTransport(tr http.RoundTripper) ClientOption {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// WithInsecure adds a insecure transport that bypasses TLS verification.
|
|
|
|
|
func WithInsecure() ClientOption {
|
|
|
|
|
return func(o *clientOptions) error {
|
|
|
|
|
o.transport = &http.Transport{
|
|
|
|
|
Proxy: http.ProxyFromEnvironment,
|
|
|
|
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// WithRootFile will create the transport using the given root certificate. It
|
|
|
|
|
// will fail if a previous option to create the transport has been configured.
|
|
|
|
|
func WithRootFile(filename string) ClientOption {
|
|
|
|
|