mirror of https://github.com/Xhofe/alist
feat(webdav): add `tls_insecure_skip_verify` field (close #5490)
parent
4355dae491
commit
91f51f17d0
|
@ -11,6 +11,7 @@ type Addition struct {
|
|||
Username string `json:"username" required:"true"`
|
||||
Password string `json:"password" required:"true"`
|
||||
driver.RootPath
|
||||
TlsInsecureSkipVerify bool `json:"tls_insecure_skip_verify" default:"false"`
|
||||
}
|
||||
|
||||
var config = driver.Config{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package webdav
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net/http"
|
||||
"net/http/cookiejar"
|
||||
|
||||
|
@ -17,6 +18,10 @@ func (d *WebDav) isSharepoint() bool {
|
|||
|
||||
func (d *WebDav) setClient() error {
|
||||
c := gowebdav.NewClient(d.Address, d.Username, d.Password)
|
||||
c.SetTransport(&http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: d.TlsInsecureSkipVerify},
|
||||
})
|
||||
if d.isSharepoint() {
|
||||
cookie, err := odrvcookie.GetCookie(d.Username, d.Password, d.Address)
|
||||
if err == nil {
|
||||
|
|
Loading…
Reference in New Issue