我正在尝试将Spring Boot与Mongodb Atlas连接起来,但是连接失败并显示此错误:
Caused by: javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No subject alternative names
matching IP address xxx.xxx.xxx.xxx found
(驱动程序版本mongodb-driver-core-3.11.2.jar)
这是我的uri连接:
mongodb://XXX:YYY@xxx-00:27017,xxx-01:27017,xxx-02:27017/dbName?ssl=true&replicaSet=set-shared-0&authSource=admin
我通过nodejs连接相同的uri和相同的机器没有问题
Atlas仅允许客户端从项目白名单中的条目连接到群集。要进行连接,必须将一个条目添加到白名单。也许,这就是原因。