insecure option 제거
This commit is contained in:
@ -2,7 +2,6 @@ package gocommon
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
"crypto/tls"
|
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -94,12 +93,9 @@ func LoadConfig[T any](outptr *T) error {
|
|||||||
h.Write([]byte(subpath))
|
h.Write([]byte(subpath))
|
||||||
at := hex.EncodeToString(h.Sum(nil))
|
at := hex.EncodeToString(h.Sum(nil))
|
||||||
|
|
||||||
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
|
||||||
|
|
||||||
req, _ := http.NewRequest("GET", configfilepath, nil)
|
req, _ := http.NewRequest("GET", configfilepath, nil)
|
||||||
req.Header.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51")
|
req.Header.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51")
|
||||||
req.Header.Add("As-X-UrlHash", at)
|
req.Header.Add("As-X-UrlHash", at)
|
||||||
http.DefaultClient.Transport.(*http.Transport).TLSClientConfig.InsecureSkipVerify = true
|
|
||||||
|
|
||||||
resp, err := http.DefaultClient.Do(req)
|
resp, err := http.DefaultClient.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user