Skip to content

Commit 19058cd

Browse files
authored
fix: Skip https certificate verification (#268)
1 parent 5ecf4ae commit 19058cd

File tree

40 files changed

+27
-8825
lines changed

40 files changed

+27
-8825
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
### Master
44

5+
- fix: Skip https certificate verification
6+
57
### 3.0.37
68

79
- update: meta data

config/profile.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
package config
1515

1616
import (
17-
"crypto/tls"
1817
"encoding/json"
1918
"errors"
2019
"fmt"
21-
"net/http"
2220
"os"
2321
"regexp"
2422
"strconv"
@@ -176,11 +174,7 @@ func (cp *Profile) ValidateAK() error {
176174

177175
func (cp *Profile) GetClient(ctx *cli.Context) (*sdk.Client, error) {
178176
config := sdk.NewConfig()
179-
if SkipSecureVerify(ctx.Flags()).IsAssigned() {
180-
config.HttpTransport = &http.Transport{
181-
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
182-
}
183-
}
177+
184178
if cp.RetryCount > 0 {
185179
config.WithMaxRetryTime(cp.RetryCount)
186180
}
@@ -209,6 +203,9 @@ func (cp *Profile) GetClient(ctx *cli.Context) (*sdk.Client, error) {
209203
if cp.ConnectTimeout > 0 {
210204
client.SetConnectTimeout(time.Duration(cp.ConnectTimeout) * time.Second)
211205
}
206+
if SkipSecureVerify(ctx.Flags()).IsAssigned() {
207+
client.SetHTTPSInsecure(true)
208+
}
212209
}
213210
return client, err
214211
}

vendor/github.com/droundy/goopt/.build

100755100644
File mode changed.

vendor/github.com/droundy/goopt/.test

100755100644
File mode changed.

vendor/github.com/droundy/goopt/setup-git.sh

100755100644
File mode changed.

vendor/github.com/json-iterator/go/build.sh

100755100644
File mode changed.

vendor/github.com/json-iterator/go/test.sh

100755100644
File mode changed.

vendor/github.com/modern-go/concurrent/test.sh

100755100644
File mode changed.

0 commit comments

Comments
 (0)