Repository: AlistGo/alist (language: go)

Issue:
挂载另一个alist时，对方的证书可能有问题，忽略对方的证书错误问题 
### Please make sure of the following things

- [ ] I have read the [documentation](https://alist.nn.ci).
- [ ] I'm sure there are no duplicate issues or discussions.
- [ ] I'm sure this feature is not implemented.
- [ ] I'm sure it's a reasonable and popular requirement.

### Description of the feature / 需求描述

挂载另一个alist时，对方的证书可能有问题，忽略对方的证书错误问题 

### Suggested solution / 实现思路

在程序中发器一个https链接时，有参数可以忽略掉证书错误问题

### Additional context / 附件
改完代码可以使用这个地址验证   https://8.210.252.203/
_No response_


Discussion / hints:
Thanks for opening your first issue here! Be sure to follow the issue template!

### See
1. 53% #66
2. 51% #3071
3. 51% #2862
4. 51% #1572
5. 51% #142
6. 51% #52
7. 50% #1873
8. 50% #860

<!-- Created by actions-cool/issues-similarity-analysis. Do not remove. -->

Fix patch:
diff --git a/drivers/base/client.go b/drivers/base/client.go
index 02e314b2481..ca1a1166fe6 100644
--- a/drivers/base/client.go
+++ b/drivers/base/client.go
@@ -23,8 +23,9 @@ func init() {
 }
 
 func NewRestyClient() *resty.Client {
-	return resty.New().
+	client := resty.New().
 		SetHeader("user-agent", UserAgent).
 		SetRetryCount(3).
 		SetTimeout(DefaultTimeout)
+	return client
 }
diff --git a/internal/bootstrap/config.go b/internal/bootstrap/config.go
index 9e78d945b58..4bb55b1a1ad 100644
--- a/internal/bootstrap/config.go
+++ b/internal/bootstrap/config.go
@@ -1,10 +1,12 @@
 package bootstrap
 
 import (
+	"crypto/tls"
 	"os"
 	"path/filepath"
 
 	"github.com/alist-org/alist/v3/cmd/flags"
+	"github.com/alist-org/alist/v3/drivers/base"
 	"github.com/alist-org/alist/v3/internal/conf"
 	"github.com/alist-org/alist/v3/pkg/utils"
 	"github.com/caarlos0/env/v7"
@@ -49,7 +51,7 @@ func InitConfig() {
 		if err != nil {
 			log.Fatalf("marshal config error: %+v", err)
 		}
-		err = os.WriteFile(configPath, confBody, 0777)
+		err = os.WriteFile(configPath, confBody, 0o777)
 		if err != nil {
 			log.Fatalf("update config struct error: %+v", err)
 		}
@@ -69,11 +71,14 @@ func InitConfig() {
 	if err != nil {
 		log.Errorln("failed delete temp file:", err)
 	}
-	err = os.MkdirAll(conf.Conf.TempDir, 0777)
+	err = os.MkdirAll(conf.Conf.TempDir, 0o777)
 	if err != nil {
 		log.Fatalf("create temp dir error: %+v", err)
 	}
 	log.Debugf("config: %+v", conf.Conf)
+	if conf.Conf.TlsInsecureSkipVerify {
+		base.RestyClient = base.RestyClient.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true})
+	}
 }
 
 func confFromEnv() {
diff --git a/internal/conf/config.go b/internal/conf/config.go
index ea09cf75234..2e7011f7c62 100644
--- a/internal/conf/config.go
+++ b/internal/conf/config.go
@@ -35,19 +35,20 @@ type LogConfig struct {
 }
 
 type Config struct {
-	Force          bool      `json:"force" env:"FORCE"`
-	Address        string    `json:"address" env:"ADDR"`
-	Port           int       `json:"port" env:"PORT"`
-	SiteURL        string    `json:"site_url" env:"SITE_URL"`
-	Cdn            string    `json:"cdn" env:"CDN"`
-	JwtSecret      string    `json:"jwt_secret" env:"JWT_SECRET"`
-	TokenExpiresIn int       `json:"token_expires_in" env:"TOKEN_EXPIRES_IN"`
-	Database       Database  `json:"database"`
-	Scheme         Scheme    `json:"scheme"`
-	TempDir        string    `json:"temp_dir" env:"TEMP_DIR"`
-	BleveDir       string    `json:"bleve_dir" env:"BLEVE_DIR"`
-	Log            LogConfig `json:"log"`
-	MaxConnections int       `json:"max_connections" env:"MAX_CONNECTIONS"`
+	Force                 bool      `json:"force" env:"FORCE"`
+	Address               string    `json:"address" env:"ADDR"`
+	Port                  int       `json:"port" env:"PORT"`
+	SiteURL               string    `json:"site_url" env:"SITE_URL"`
+	Cdn                   string    `json:"cdn" env:"CDN"`
+	JwtSecret             string    `json:"jwt_secret" env:"JWT_SECRET"`
+	TokenExpiresIn        int       `json:"token_expires_in" env:"TOKEN_EXPIRES_IN"`
+	Database              Database  `json:"database"`
+	Scheme                Scheme    `json:"scheme"`
+	TempDir               string    `json:"temp_dir" env:"TEMP_DIR"`
+	BleveDir              string    `json:"bleve_dir" env:"BLEVE_DIR"`
+	Log                   LogConfig `json:"log"`
+	MaxConnections        int       `json:"max_connections" env:"MAX_CONNECTIONS"`
+	TlsInsecureSkipVerify bool      `json:"tls_insecure_skip_verify" env:"TLS_INSECURE_SKIP_VERIFY"`
 }
 
 func DefaultConfig() *Config {
@@ -75,6 +76,7 @@ func DefaultConfig() *Config {
 			MaxBackups: 5,
 			MaxAge:     28,
 		},
-		MaxConnections: 0,
+		MaxConnections:        0,
+		TlsInsecureSkipVerify: false,
 	}
 }


Test patch: