Skip to content

Commit

Permalink
Add TLSClientConfig to defaultDialer.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodauria committed Sep 28, 2023
1 parent 24be2a2 commit 6ecdd3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package client

import (
"context"
"crypto/tls"
"errors"
"fmt"
"log"
Expand Down Expand Up @@ -47,7 +48,7 @@ var (
)

// defaultDialer is the default websocket.Dialer used by the client.
// It wraps the net.Conn with a netx.Conn.
// Its NetDial function wraps the net.Conn with a netx.Conn.
var defaultDialer = &websocket.Dialer{
HandshakeTimeout: DefaultWebSocketHandshakeTimeout,
NetDial: func(network, addr string) (net.Conn, error) {
Expand All @@ -57,6 +58,7 @@ var defaultDialer = &websocket.Dialer{
}
return netx.FromTCPConn(conn.(*net.TCPConn))

Check failure on line 59 in pkg/client/client.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: netx.FromTCPConn

Check failure on line 59 in pkg/client/client.go

View workflow job for this annotation

GitHub Actions / build_and_run_tests (1.20.2, ubuntu-22.04)

undefined: netx.FromTCPConn
},
TLSClientConfig: &tls.Config{},
}

// Locator is an interface used to get a list of available servers to test against.
Expand Down Expand Up @@ -108,7 +110,6 @@ func makeUserAgent(clientName, clientVersion string) string {
// New returns a new Throughput1Client with the provided client name, version and config.
func New(clientName, clientVersion string, config Config) *Throughput1Client {
defaultDialer.TLSClientConfig.InsecureSkipVerify = config.NoVerify

return &Throughput1Client{
ClientName: clientName,
ClientVersion: clientVersion,
Expand Down

0 comments on commit 6ecdd3c

Please sign in to comment.