简体   繁体   English

NodeJS SSL选项-严格SSL与拒绝

[英]NodeJS SSL options - strictSSL vs rejectUnauthorized

What is the difference between strictSSL=false and rejectUnauthorized=false options in NodeJS? NodeJS中strictSSL = falserejectUnauthorized = false选项之间有什么区别?

The names are confusing and I did not find documentation, explaining the difference. 名称令人困惑,我没有找到文档来解释差异。

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 : 一方面,您可以在节点运行时上下文中查看rejectUnauthorized = false标志,它在答案中引用:

By setting rejectUnauthorized: false, you're saying "I don't care if I can't verify the server's identity." 通过设置rejectUnauthorized:false,您说的是“我不在乎是否无法验证服务器的身份。” Obviously, this is not a good solution as it leaves you vulnerable to MITM attacks. 显然,这不是一个好的解决方案,因为它使您容易受到MITM攻击。

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. 虽然你可以看看strictSSL = false作为多个构建和设置方面 ,因为这是你从HTTP源代码安装时的依赖,而不是HTTPS作为中提到的传递给故宫的标志这个职位。

HTH. HTH。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM