Skip to content

Commit

Permalink
client.go
Browse files Browse the repository at this point in the history
fix lint issue
  • Loading branch information
pmalhaire authored Jul 9, 2024
1 parent d46c223 commit 323a158
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type conf struct {
// path to client cert key file
clientCertKeyPath string
// wether to skip the cert validity check
skipTlsValidation bool
skipTLSValidation bool
}

const (
Expand Down Expand Up @@ -164,8 +164,8 @@ func (m *MqttAPI) client(c goja.ConstructorCall) *goja.Object {
common.Throw(m.vu.Runtime(), err)
}

skipTls := c.Argument(10)
clientConf.skipTlsValidation = skipTls.ToBoolean()
skipTLS := c.Argument(10)
clientConf.skipTLSValidation = skipTLS.ToBoolean()

client := &client{
vu: m.vu,
Expand Down Expand Up @@ -236,8 +236,11 @@ func (c *client) Connect() error {
}
}

tlsConfig = &tls.Config{
InsecureSkipVerify: c.conf.skipTlsValidation,
// set tls if skip is forced
if c.conf.skipTLSValidation {
tlsConfig = &tls.Config{
InsecureSkipVerify: c.conf.skipTLSValidation, //nolint:gosec
}
}

if tlsConfig != nil {
Expand Down

0 comments on commit 323a158

Please sign in to comment.