Skip to content

Commit

Permalink
Merge pull request #280 from nange/fix/utls
Browse files Browse the repository at this point in the history
Fix RootCAs setting when using utls
  • Loading branch information
imroc authored Sep 7, 2023
2 parents 6fe6ed1 + ebe4e19 commit 3ab7af1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"encoding/json"
"encoding/xml"
"errors"
"github.com/imroc/req/v3/http2"
"io"
"net"
"net/http"
Expand All @@ -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.
Expand Down Expand Up @@ -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,
}
Expand Down

0 comments on commit 3ab7af1

Please sign in to comment.