From 91a39cbbb2aaaf9e0e23a8ef46a97daff5977ee5 Mon Sep 17 00:00:00 2001 From: steden <1470804@qq.com> Date: Thu, 20 Jun 2024 17:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E4=B8=8D=E9=AA=8C=E8=AF=81https?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- saveTraceContextConsumer.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/saveTraceContextConsumer.go b/saveTraceContextConsumer.go index 6b7666b..3315858 100644 --- a/saveTraceContextConsumer.go +++ b/saveTraceContextConsumer.go @@ -2,6 +2,7 @@ package linkTrace import ( "bytes" + "crypto/tls" "encoding/json" "fmt" "github.com/farseer-go/collections" @@ -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())