Not emitting error when fail to connect to database expecting encrypt = true
I've not been able to determine why mssql (3.3.0) is not emitting an error event when tedious fails to connect to a database that expects encrypted connect but the options.encrypt = false. It seems that tedious is not emitting the error.
I've stepped in through mssql main.js down into selection of tedious driver and as far as the tedious call for new Connection (in tedious.js) c = new tds.Connection(cfg); // this fails but not emitting error Stepping further into the tds.Connection call, am getting to the connectOnPort function, but after attempt to connect socket, hang occurs at this.socket.connect(connectOpts); // tedious connection.js fails if encrypt not set appropriately
I've attempted to catch an error in multiple means (callback, promise, or event listener), but mssql doesn't allow or catch (depending on the case) the error.
Can this issue be resolved? This failure crashes the node application as the hang-up never resolves, not even with timeout settings on the connection options or pool.
Attaching comparison of debug logs (stripped packets for readability) when fails (missing encrypt) vs succeeds (encrypt set):

Fwiw, I've submitted #606 explicitly to auto-escalate the ecnryption when the client configuration doesn't specify encrypt=true, but the server requires it.
This should've been fixed by https://github.com/tediousjs/tedious/pull/514 Can you see if your versions of tedious has this fix?
#514 fixes this issue.