我正在尝试在 node.js 上的 MQTT 中实现安全性。我不太明白下面的段落。
https://github.com/mqttjs/MQTT.js
In case mqtts (mqtt over tls) is required, the options object is passed through to tls.connect(). If you are using a self-signed certificate, pass the rejectUnauthorized: false option. Beware that you are exposing yourself to man in the middle attacks, so it is a configuration that is not recommended for production environments.
最佳答案
如果您使用 rejectUnauthorized
,则客户端将接受来自远程系统的任何证书。
这意味着攻击者可以创建他们自己的自签名证书,并将他们自己插入到您和您的经纪人之间,而您将无法知道他们有。
如果你用我在另一个question的回答中提到的方法您可以确定您正在使用您的证书连接到代理
关于node.js - 在 TLS 中使用自签名证书如何使一个人受到中间人攻击?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40036725/