Failed to connect to DESKTOP-35COSO3\MSSQLSERVER03:1433 - self-signed certificate

Anjali Kumawat 20 Reputation points
2024-03-28T09:37:41.9633333+00:00

Get this error while connecting my node js to MSSQL server.

User's image

PS C:\Users\ANJALI\Documents\Curate\Website\Backend> node index.js

ConnectionError: Failed to connect to DESKTOP-35COSO3\MSSQLSERVER03:1433 - self-signed certificate

at Connection.socketError (C:\Users\ANJALI\Documents\Curate\Website\Backend\node_modules\tedious\lib\connection.js:1338:28)

at C:\Users\ANJALI\Documents\Curate\Website\Backend\node_modules\tedious\lib\connection.js:2238:25

at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {

code: 'ESOCKET'

}

SQL Server | Other
{count} votes

1 answer

Sort by: Most helpful
  1. LiHongMSFT-4306 31,616 Reputation points
    2024-03-29T03:13:09.6766667+00:00

    Hi @Anjali Kumawat

    How about adding trustedConnection: true, inside the options of connectionSettings?

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.