Skip to content

Commit

Permalink
Additional check for TLS required in WebSocket INFO (#4264)
Browse files Browse the repository at this point in the history
This should stop us reporting `tls_required` when we aren't reporting
`tls_available`.

Signed-off-by: Neil Twigg <neil@nats.io>
  • Loading branch information
derekcollison committed Jun 21, 2023
2 parents f4f3cce + cf71584 commit a8fc352
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/client.go
Expand Up @@ -2170,7 +2170,7 @@ func (c *client) generateClientInfoJSON(info Info) []byte {
if c.srv != nil { // Otherwise lame duck info can panic
c.srv.websocket.mu.RLock()
info.TLSAvailable = c.srv.websocket.tls
if c.srv.websocket.server != nil {
if c.srv.websocket.tls && c.srv.websocket.server != nil {
if tc := c.srv.websocket.server.TLSConfig; tc != nil {
info.TLSRequired = !tc.InsecureSkipVerify
}
Expand Down

0 comments on commit a8fc352

Please sign in to comment.