You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
601 B
33 lines
601 B
package client
|
|
|
|
import (
|
|
"crypto/tls"
|
|
"net/http"
|
|
"time"
|
|
|
|
"github.com/rudecs/decort-sdk/config"
|
|
)
|
|
|
|
// NewLegacyHttpClient creates legacy HTTP Client
|
|
func NewLegacyHttpClient(cfg config.LegacyConfig) *http.Client {
|
|
transCfg := &http.Transport{
|
|
TLSClientConfig: &tls.Config{
|
|
//nolint:gosec
|
|
InsecureSkipVerify: cfg.SSLSkipVerify,
|
|
},
|
|
}
|
|
|
|
return &http.Client{
|
|
Transport: &transportLegacy{
|
|
base: transCfg,
|
|
username: cfg.Username,
|
|
password: cfg.Password,
|
|
retries: cfg.Retries,
|
|
token: cfg.Token,
|
|
decortURL: cfg.DecortURL,
|
|
},
|
|
|
|
Timeout: 5 * time.Minute,
|
|
}
|
|
}
|