Skip to content

Commit

Permalink
Fix https source, again
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Nov 15, 2023
1 parent befa6bd commit 269beab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/tcp/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func Do(req *http.Request) (*http.Response, error) {
if err != nil {
return nil, err
}
secure := ctx.Value(connKey).(*tls.Config)
secure := ctx.Value(secureKey).(*tls.Config)
tlsConn := tls.Client(conn, secure)
if err = tlsConn.Handshake(); err != nil {
return nil, err
Expand Down Expand Up @@ -128,7 +128,11 @@ func Do(req *http.Request) (*http.Response, error) {
}

var client *http.Client
var connKey, secureKey struct{}

type key string

var connKey = key("conn")
var secureKey = key("secure")

func WithConn() (context.Context, *net.Conn) {
pconn := new(net.Conn)
Expand Down

0 comments on commit 269beab

Please sign in to comment.