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 {
|
func (d *Cloud189) Init(ctx context.Context) error {
|
||||||
d.client = resty.New().
|
d.client = base.NewRestyClient().
|
||||||
SetTimeout(base.DefaultTimeout).
|
SetHeader("Referer", "https://cloud.189.cn/")
|
||||||
SetRetryCount(3).
|
|
||||||
SetHeader("Referer", "https://cloud.189.cn/").
|
|
||||||
SetHeader("User-Agent", base.UserAgent)
|
|
||||||
return d.login()
|
return d.login()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package base
|
package base
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/tls"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/alist-org/alist/v3/internal/conf"
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -27,5 +29,8 @@ func NewRestyClient() *resty.Client {
|
||||||
SetHeader("user-agent", UserAgent).
|
SetHeader("user-agent", UserAgent).
|
||||||
SetRetryCount(3).
|
SetRetryCount(3).
|
||||||
SetTimeout(DefaultTimeout)
|
SetTimeout(DefaultTimeout)
|
||||||
|
if conf.Conf.TlsInsecureSkipVerify {
|
||||||
|
client = client.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true})
|
||||||
|
}
|
||||||
return client
|
return client
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue