question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unsupported Protocol Error

See original GitHub issue

I am seeing the below error when trying to connect to a local sql server database using tedious. I have tried both using the IP address and localhost and it won’t connect. TCP/IP is enabled for MSSQLSERVER in sql server configuration manager. I also verified that sql server browser is also running.

Error:

ConnectionError: Failed to connect to 127.0.0.1:1433 - 22996:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:c:\ws\deps\openssl\openssl\ssl\statem\statem_lib.c:1942:

at ConnectionError (E:\ExpressServer\kagetruckroutingappServer\node_modules\tedious\lib\errors.js:13:12)
at Connection.socketError (E:\ExpressServer\kagetruckroutingappServer\node_modules\tedious\lib\connection.js:1641:56)
at Socket.<anonymous> (E:\ExpressServer\kagetruckroutingappServer\node_modules\tedious\lib\connection.js:1405:14)
at Socket.emit (events.js:326:22)
at emitErrorNT (internal/streams/destroy.js:100:8)
at emitErrorCloseNT (internal/streams/destroy.js:68:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {

code: ‘ESOCKET’ } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! kagetruckroutingappserver@0.0.0 start: node ./bin/www npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the kagetruckroutingappserver@0.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! Redacted

Code:

var Connection = require('tedious').Connection; 
var Request = require('tedious').Request;  
console.log('start')
var config = {
  server: 'localhost',
  authentication: {
    type: 'default',
    options: {
      userName: 'redacted', // update me
      password: 'redacted' // update me
    },
    options: {
      encrypt: false, 
      cryptoCredentialsDetails: {
        minVersion: 'TLSv1'
    }
    }
  }
}
    var connection = new Connection(config);  
    console.log('after connection variable')
    connection.connect();
    console.log('after connect')
    connection.on('connect', function(err) { 
      if (err) {
        console.log('Connection Failed');
        throw err;
      } 
        // If no error, then good to proceed.
        console.log("Connected");  
        
    });

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:25 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Estefania-Pichardo-Montescommented, May 14, 2021

Hey, i already resolve the issue, adding the suggested option i get another error but i realize that the error was that i was using the user of windows authentication instead of an sql server user, thank you

1reaction
kagedevelopmentcommented, May 13, 2021

Try adding this options:

options: { trustServerCertificate: true

}

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix “ERR_SSL_PROTOCOL_ERROR” for ... - SSL2BUY
1. Check the Date of Your System · 2. Clear Browsing Data · 3. Clear Your SSL State · 4. Disable QUIC Protocol...
Read more >
How to Fix the Err_Ssl_Version_or_Cipher_Mismatch Error
1. Checking the SSL certificate · 2. Certificate Name Mismatch issue · 3. Checking for an old and unsupported version of TLS ·...
Read more >
How to Fix ERR_SSL_PROTOCOL_ERROR on Google Chrome
A quick guide on how to fix ERR_SSL_PROTOCOL_ERROR, Google Chrome's "This site can't provide a secure connection" message.
Read more >
What Does 'Unsupported Protocol' Mean? - Dext Help Center
This means you have an outdated browser that does not use TLS 1.2. To continue accessing Dext Prepare after 20th February 2020 you...
Read more >
SSL Error: This Site Can't Provide a Secure Connection in ...
This site can't provide a secure connection. sitename.com uses an unsupported protocol. ERR_SSL_VERSION_OR_CIPHER_MISMATCH.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found