network InsecureSkipVerify
This commit is contained in:
parent
ee50523980
commit
5d600f2684
1 changed files with 13 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ package network
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
|
@ -93,7 +94,18 @@ func RequestSend(method string, url string, params map[string]interface{}, data
|
|||
}
|
||||
}
|
||||
|
||||
resp, err := (&http.Client{}).Do(req)
|
||||
// Https
|
||||
var client *http.Client = &http.Client{}
|
||||
|
||||
// SkipVerify false
|
||||
if strings.HasPrefix(url, "https://") {
|
||||
tr := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
client = &http.Client{Transport: tr}
|
||||
}
|
||||
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return Response{
|
||||
Status: 0,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue