Skip to content

Commit

Permalink
Fix: WebSocket: Clone TLS config before creating a new listener
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Aug 29, 2024
1 parent 9c49960 commit 8955761
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion p2p/transport/websocket/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ func (t *WebsocketTransport) maDial(ctx context.Context, raddr ma.Multiaddr) (ma
}

func (t *WebsocketTransport) maListen(a ma.Multiaddr) (manet.Listener, error) {
l, err := newListener(a, t.tlsConf)
var tlsConf *tls.Config
if t.tlsConf != nil {
tlsConf = t.tlsConf.Clone()
}
l, err := newListener(a, tlsConf)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 8955761

Please sign in to comment.