Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #390

Merged
merged 1 commit into from
Jul 23, 2024
Merged

fix #390

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions gout_issue_389_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package gout

import "testing"

func Test_Issue_389(t *testing.T) {
_ = NewWithOpt(WithProxy("http://127.0.0.1:7897"), WithInsecureSkipVerify())

// client.GET("https://api.ipify.org?format=json").Debug(true).Do()
}
16 changes: 11 additions & 5 deletions gout_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ type Option interface {
type insecureSkipVerifyOption bool

func (i insecureSkipVerifyOption) apply(opts *options) {
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},

if opts.hc.Transport == nil {
opts.hc.Transport = &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
return
}
opts.hc.Transport.(*http.Transport).TLSClientConfig = &tls.Config{
InsecureSkipVerify: true,
}

opts.hc.Transport = tr
}

// 1.忽略ssl验证
Expand Down
Loading