Skip to content

Commit

Permalink
skip verify ssl https
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamlu committed Sep 25, 2023
1 parent 276f2dd commit 85488f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
better mock code implementation to replace faker
TMap[string,T] to TMap[K,V]
optimize src/file
optimize src/file
skip verify ssl https
9 changes: 9 additions & 0 deletions src/ghttp/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ghttp

import (
"bytes"
"crypto/tls"
"encoding/json"
"github.com/dreamlu/gt/src/file/fs"
"github.com/dreamlu/gt/src/type/cmap"
Expand Down Expand Up @@ -173,6 +174,14 @@ func (m *Request) Exec() *Response {
req.AddCookie(cookie)
}

// skip verify ssl https
tc := &tls.Config{
InsecureSkipVerify: true,
}
m.Client.Transport = &http.Transport{
TLSClientConfig: tc,
}

resp, err := m.Client.Do(req)
if resp != nil {
defer resp.Body.Close()
Expand Down

0 comments on commit 85488f9

Please sign in to comment.