Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NodeJS SSL options - strictSSL vs rejectUnauthorized

Tags:

node.js

ssl

What is the difference between strictSSL=false and rejectUnauthorized=false options in NodeJS?

The names are confusing and I did not find documentation, explaining the difference.

like image 452
Andrew Rukin Avatar asked May 01 '26 22:05

Andrew Rukin


1 Answers

I think these two flag options are used in different context and are not exactly comparable. On one hand, you can look at rejectUnauthorized=false flag in node runtime context which does as quoted in this answer :

By setting rejectUnauthorized: false, you're saying "I don't care if I can't verify the server's identity." Obviously, this is not a good solution as it leaves you vulnerable to MITM attacks.

Whereas you can look at strictSSL=false as more build and setup context as this is the flag you pass to npm when installing dependencies from an HTTP source rather than https as mentioned in this post.

HTH.

like image 93
damitj07 Avatar answered May 03 '26 16:05

damitj07



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!