From ebe4e19b04b482e7020b69fb9bd823392845bf01 Mon Sep 17 00:00:00 2001 From: nange Date: Thu, 7 Sep 2023 16:59:40 +0800 Subject: [PATCH] Fix RootCAs setting when using utls --- client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index ae4035a0..1a14c6d5 100644 --- a/client.go +++ b/client.go @@ -8,7 +8,6 @@ import ( "encoding/json" "encoding/xml" "errors" - "github.com/imroc/req/v3/http2" "io" "net" "net/http" @@ -19,11 +18,11 @@ import ( "strings" "time" - "golang.org/x/net/publicsuffix" - + "github.com/imroc/req/v3/http2" "github.com/imroc/req/v3/internal/header" "github.com/imroc/req/v3/internal/util" utls "github.com/refraction-networking/utls" + "golang.org/x/net/publicsuffix" ) // DefaultClient returns the global default Client. @@ -1179,6 +1178,7 @@ func (c *Client) SetTLSFingerprint(clientHelloID utls.ClientHelloID) *Client { hostname := addr[:colonPos] utlsConfig := &utls.Config{ ServerName: hostname, + RootCAs: c.GetTLSClientConfig().RootCAs, NextProtos: c.GetTLSClientConfig().NextProtos, InsecureSkipVerify: c.GetTLSClientConfig().InsecureSkipVerify, }