feat(webdav): add tls_insecure_skip_verify field (close #5490)

This commit is contained in:
Andy Hsu
2023-11-10 15:38:23 +08:00
parent 4355dae491
commit 91f51f17d0
2 changed files with 6 additions and 0 deletions

View File

@ -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 {