Client network socket disconnected before secure TLS connection was established USING PM2 in node

Trying to fix ssl issue in Node 18+ version adding node_args with pm2 commands
node_args: [‘–tls-max-v1.3’, ‘–tls-min-v1.3’],

this is working fine with dummy code but not working with project repo code, I am getting this error after adding node_args without args getting ssl error in node version more than 18

Error: Client network socket disconnected before secure TLS connection was established at Function.connect (C:\Users\NASHEKH\project-repos\chubb-studio-native-apis\node_modules@studio\sapi-utils\dist\db-operations\db-connection.js:34:19) at C:\Us

@SourabhBagrecha we are working in private company network and getting this error with node 18+ could you please help to resolve this issue.

Based on the filenames it looks like the app is connecting to cosmos not MongoDB.

Be sure the endpoint you’re connecting supports TLS1.3

Actually we are migrating data from cosmos to mongodb so we are connecting with both In my case cosmos is working fine we are setting tlsv1.3 for mongodb that is not working.

with node 16 working with tls 1.1 as well but i am trying to fix the same issue with node 20 and tls v1.3

because with tls1.1 getting ssl error in it.

Does mongosh or Compass from the same host connect okay?

Usual suspects such as updating the Project’s Network Allow List ?

yes working same with compass directly, I am facing issue in repo code using mongo with node 18+

Not a node pro but this works for me fine on my M0, node v21.4.0 (just the container I have cached), driver 6.3.0

node --tls-min-v1.3 --tls-max-v1.3 app.js

Yes, i tried with these commands but not working with repo code using PM2 node_args.

@Narpat_Shekhawat I sent you a message looking for more info we can use to troubleshoot this.

Note for anyone coming to this question a potential solution is documented at Node.js Driver failing to connect due to unsafe legacy renegotiation disabled | ALEX BEVILACQUA.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.