mirror of https://github.com/Xhofe/alist
fix(189): enable `TlsInsecureSkipVerify` (close #4355)
parent
ea88998325
commit
e15755fef0
|
@ -30,11 +30,8 @@ func (d *Cloud189) GetAddition() driver.Additional {
|
|||
}
|
||||
|
||||
func (d *Cloud189) Init(ctx context.Context) error {
|
||||
d.client = resty.New().
|
||||
SetTimeout(base.DefaultTimeout).
|
||||
SetRetryCount(3).
|
||||
SetHeader("Referer", "https://cloud.189.cn/").
|
||||
SetHeader("User-Agent", base.UserAgent)
|
||||
d.client = base.NewRestyClient().
|
||||
SetHeader("Referer", "https://cloud.189.cn/")
|
||||
return d.login()
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue