add skip_tls_verify option for exchange rates

This commit is contained in:
MaysWind
2023-09-17 17:24:41 +08:00
parent 04ec749c3c
commit 92273d2fc6
3 changed files with 16 additions and 1 deletions
+11 -1
View File
@@ -1,6 +1,7 @@
package api
import (
"crypto/tls"
"io"
"net/http"
"sort"
@@ -32,8 +33,17 @@ func (a *ExchangeRatesApi) LatestExchangeRateHandler(c *core.Context) (interface
uid := c.GetCurrentUid()
transport := http.DefaultTransport.(*http.Transport).Clone()
if settings.Container.Current.ExchangeRatesSkipTLSVerify {
transport.TLSClientConfig = &tls.Config{
InsecureSkipVerify: true,
}
}
client := &http.Client{
Timeout: time.Duration(settings.Container.Current.ExchangeRatesRequestTimeout) * time.Millisecond,
Transport: transport,
Timeout: time.Duration(settings.Container.Current.ExchangeRatesRequestTimeout) * time.Millisecond,
}
urls := dataSource.GetRequestUrls()