tediousjs / node-mssql

Microsoft SQL Server client for Node.js
https://tediousjs.github.io/node-mssql
MIT License
2.23k stars 467 forks source link

Connection string backslash problems #1472

Closed Bellier-Oeba closed 1 year ago

Bellier-Oeba commented 1 year ago

Hello!

We have a Microsoft SQL Server in our local network and trying to connect to him

Expected behaviour:

Expected connection to be etablished

Actual behaviour:

ConnectionError: Failed to connect to SRV-SEQUOIA:undefined - 16030600:error:100000f0:SSL routines:OPENSSL_internal:UNSUPPORTED_PROTOCOL:..\..\third_party\boringssl\src\ssl\handshake_client.cc:705:

    at C:\Users\be6\Documents\Lab\GitHub\Bellier-Edition\node_modules\mssql\lib\tedious\connection-pool.js:70:17
    at Connection.onConnect (C:\Users\be6\Documents\Lab\GitHub\Bellier-Edition\node_modules\tedious\lib\connection.js:1012:9)
    at Object.onceWrapper (node:events:628:26)
    at Connection.emit (node:events:513:28)
    at Connection.emit (C:\Users\be6\Documents\Lab\GitHub\Bellier-Edition\node_modules\tedious\lib\connection.js:1040:18)
    at Connection.socketError (C:\Users\be6\Documents\Lab\GitHub\Bellier-Edition\node_modules\tedious\lib\connection.js:1395:12)
    at C:\Users\be6\Documents\Lab\GitHub\Bellier-Edition\node_modules\tedious\lib\connection.js:2402:25
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ESOCKET',
  originalError: ConnectionError: Failed to connect to SRV-SEQUOIA:undefined - 16030600:error:100000f0:SSL routines:OPENSSL_internal:UNSUPPORTED_PROTOCOL:..\..\third_party\boringssl\src\ssl\handshake_client.cc:705:

      at Connection.socketError (C:\Users\be6\Documents\Lab\GitHub\Bellier-Edition\node_modules\tedious\lib\connection.js:1395:28)
      at C:\Users\be6\Documents\Lab\GitHub\Bellier-Edition\node_modules\tedious\lib\connection.js:2402:25
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
    code: 'ESOCKET',
    isTransient: undefined
  }
}

According to the log its seem to his trying to connect to SRV-SEQUOIA:undefined ? Seem to be a parsing problems ? I have tried to set an instanceName options but that didn't help 😩

Related to => https://github.com/tediousjs/node-mssql/issues/213

Configuration:

const dbConfig = {
  user: "xxxxxx",
  password: "xxxxxx",
  server: "SRV-SEQUOIA\\SQLEXPRESS",
  database: "SQPR_BELLIER",
};

Software versions

dhensby commented 1 year ago

My reading of the error is that it's the TLS protocol that is not supported. What version of TLS is the server set to accept?

This does not appear to be related to #213 at all, that I can see.

I think this is most likely related to https://github.com/tediousjs/tedious/issues/1449 given it looks like a TLS negotiation issue.

Bellier-Oeba commented 1 year ago

Hello !

Sorry for the late response

My reading of the error is that it's the TLS protocol that is not supported.

Your are right, i solved the issue on adding options trustServerCertificate and encrypt has false on config object

Thanks !