Facing server error in Lambda(Node.js) after MSSQL package update

0

On updating the MSSQL package from Version6.2.0 to Version9.1.0 in package.json file , we are facing the below error .

Failed to connect to Server1_name - Hostname/IP does not match certificate's altnames: Host: Server1_name is not in the cert's altnames: DNS:Server2_name

The lambda is written in Node.js, lambda connects to mssql server in npm mssql version 6.2.0 but throws the above error in npm mssql version 9.1.1 We upgraded the version for resolving the security vulnerability reported for dependency package (xmldom).

Please guide what can be the ways to resolve the error and the root cause.

  • It would be helpful if you gave the exact library that you're referring to. For .NET code in Lambda, typically people are using either the older System.Data.SqlClient (max version 4.8.5) or the newer and recommended package Microsoft.Data.SqlClient (max version 5.1.0). There's an entity framework core package Microsoft.EntityFrameworkCore.SqlServer (max version 7.0.3) and the older Entity Framework 6 package EntityFramework (max version 6.4.4).

    Since none of these are available in version 9.1.0, it's not clear exactly what library you're using. Are you possibly using the magic.lambda.mssql library? Or something else?

  • Hi , The lambda is written in Node.js and we have package.json file were the packages required and its dependencies mentioned . Based on a security vulnerability reported for dependency package(xmldom) we had to upgrade the MSSQL package in Visual Studio Code from Version 6.2.0 to Version 9.1.1 which is leading to the above error . We dont have the sql server connection error in lambda when the MSSQL version is 6.2.0. The mentioned versions are Npm MSSQL versions

1 回答
2

According to error, there is a certificate mismatch between the server name and the alternative names listed in the certificate.

To resolve this issue, you can try the following steps:

  1. Check the certificate to make sure it is valid and has the correct alternative names listed.
  2. Ensure that the server name is correct and matches the name listed in the certificate.
  3. If the certificate is not valid or does not have the correct alternative names, update or replace the certificate.
  4. If the server name has changed, update any references to the old name with the new name.
  5. Check the network configuration to ensure that there are no issues with DNS resolution or routing that could be causing the error.
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则