Issue Description :
When my drachtio-server crashes or restarts by any reason, the drachtio-srf application tries to connect with drachtio-server without the original TLS configuration.
Technical Investigation :
WireProtocol.connect(opts) call correctly creates tls or non-tls connection based on the passed opts.
- But if the connection drops by any reason, then the function
_onConnectionGone() always creates a new non-tls connection.
- It should check if the original connection was done using tls, then the new socket should also be created with tls.
Resolution :
- Store
tls options from opts on WireProtocol.connect() function along with existing port and host.
- Reuse the
tls options to initialize a tls connection or non-tls connection conditionally as done in the original connect() function.
Issue Description :
When my drachtio-server crashes or restarts by any reason, the drachtio-srf application tries to connect with drachtio-server without the original TLS configuration.
Technical Investigation :
WireProtocol.connect(opts)call correctly creates tls or non-tls connection based on the passed opts._onConnectionGone()always creates a new non-tls connection.Resolution :
tlsoptions fromoptsonWireProtocol.connect()function along with existingportandhost.tlsoptions to initialize a tls connection or non-tls connection conditionally as done in the originalconnect()function.