Skip to content

Commit

Permalink
调整:指定不验证https
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Jun 20, 2024
1 parent 9b7bfae commit 91a39cb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion saveTraceContextConsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package linkTrace

import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"github.com/farseer-go/collections"
Expand Down Expand Up @@ -51,7 +52,13 @@ func uploadTrace(lstTraceContext any) error {
newRequest.Header.Set("Trace-Level", parse.ToString(traceContext.GetTraceLevel()))
newRequest.Header.Set("Trace-App-Name", core.AppName)
}
client := &http.Client{}
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true, // 不验证 HTTPS 证书
},
},
}
rsp, err := client.Do(newRequest)
if err != nil {
return fmt.Errorf("上传链路记录到FOPS失败:%s", err.Error())
Expand Down

0 comments on commit 91a39cb

Please sign in to comment.