fix: 更新 DownloadFile 函数以使用自定义 TLS 配置,禁用证书验证以支持不安全连接
This commit is contained in:
parent
cc40ea8b3d
commit
eafc291a93
@ -2,6 +2,7 @@ package util
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/url"
|
||||
@ -71,7 +72,10 @@ func DownloadFile(urlStr string, dirPath string) (filepath string, err error) {
|
||||
ReadTimeout: 30 * time.Second,
|
||||
WriteTimeout: 30 * time.Second,
|
||||
MaxConnWaitTimeout: 30 * time.Second,
|
||||
TLSConfig: nil, // 使用默认配置
|
||||
// TLSConfig: nil, // 使用默认配置
|
||||
TLSConfig: &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
},
|
||||
}
|
||||
|
||||
// 准备请求
|
||||
|
Loading…
x
Reference in New Issue
Block a user