编辑:没有错。 我是一个白痴。 以下设置是正确的。
我在窗口上设置了一个mongodb(3.4)的实例,像这样configuration:
net: port: 27017 ssl: mode: preferSSL PEMKeyFile: C:\...\mongodb.pem CAFile: C:\...\mongodb.ca allowConnectionsWithoutCertificates: true
证书是为特定域和通配符子域颁发的CA签名证书。
然后,我可以使用具有以下连接string的简单C#程序从本地机器连接到数据库:
mongodb://user:password@hostname?ssl=true
它工作正常。 客户端没有使用证书。
我已经摆弄了参数,它真的好像使用SSL连接:
mode:requireSSL并在连接string中设置ssl=false ,我无法连接,这是预期的 The remote certificate is invalid according to the validation procedure.得到The remote certificate is invalid according to the validation procedure. ,这也是预料之中的 no SSL certificate provided by peer – 这是预期的; 客户端没有使用证书,这就是为什么我configuration了allowConnectionsWithoutCertificates: true 但是 ,当我使用Wireshark查看stream量时,我可以检查所有数据包,并以明文方式读取发送到服务器和从服务器发送的数据。 数据包详细信息窗格中没有SSL / TLS层,只有以太网,IP,TCP和Mongo Wire协议。
我的问题是 :这是预期的吗? 不应该encryptionstream量,因此在Wireshark中不可读?