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
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,715 questions
{count} votes

1 answer

Sort by: Most helpful
  1. CosmogHong-MSFT 23,016 Reputation points Microsoft Vendor
    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".