Error: No SSL Certificate Provided By Peer
Issue
After upgrading to MongoDB version 4.2 or higher, connection setup tests fail with the following error:
no SSL certificate provided by peer; connection rejected
Environment
- Connector: MongoDB
- MongoDB version: 4.2 or higher
Resolution
To resolve this issue, add the following setting to your MongoDB configuration:
allowConnectionsWithoutCertificates: true
This setting allows MongoDB to accept TLS connections without requiring a client certificate.
Cause
In MongoDB versions lower than 4.2, the default configuration didn't enforce TLS, and client certificates weren't required unless explicitly configured. However, in MongoDB versions 4.2 and higher, MongoDB enforces mutual TLS (mTLS) by default, requiring both the server and the client to present certificates.
Fivetran doesn't present a client certificate when you add a new MongoDB connection. When you use MongoDB version 4.2 or higher without applying the above configuration change, we can't establish mTLS, resulting in the above error.