fix(189): enable TlsInsecureSkipVerify (close #4355)

This commit is contained in:
Andy Hsu
2023-05-11 18:48:16 +08:00
parent ea88998325
commit e15755fef0
2 changed files with 7 additions and 5 deletions

View File

@ -1,9 +1,11 @@
package base
import (
"crypto/tls"
"net/http"
"time"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/go-resty/resty/v2"
)
@ -27,5 +29,8 @@ func NewRestyClient() *resty.Client {
SetHeader("user-agent", UserAgent).
SetRetryCount(3).
SetTimeout(DefaultTimeout)
if conf.Conf.TlsInsecureSkipVerify {
client = client.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true})
}
return client
}