Skip to content

Commit aa08321

Browse files
joy4egTwiN
andauthored
fix(websocket): use tls config (#1165)
Co-authored-by: TwiN <[email protected]>
1 parent ad5197f commit aa08321

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

client/client.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ func QueryWebSocket(address, body string, config *Config) (bool, []byte, error)
332332
}
333333
if config != nil {
334334
wsConfig.Dialer = &net.Dialer{Timeout: config.Timeout}
335+
wsConfig.TlsConfig = &tls.Config{
336+
InsecureSkipVerify: config.Insecure,
337+
}
338+
if config.HasTLSConfig() && config.TLS.isValid() == nil {
339+
wsConfig.TlsConfig = configureTLS(wsConfig.TlsConfig, *config.TLS)
340+
}
335341
}
336342
// Dial URL
337343
ws, err := websocket.DialConfig(wsConfig)

0 commit comments

Comments
 (0)