-
Notifications
You must be signed in to change notification settings - Fork 194
Description
Versions/Environment
-
What version of Rust are you using?
v1.94.0 -
What operating system are you using?
macOS 26.2 -
What versions of the driver and its dependencies are you using? (Run
cargo pkgid mongodb&cargo pkgid bson)
registry+https://github.com/rust-lang/crates.io-index#mongodb@3.5.1
registry+https://github.com/rust-lang/crates.io-index#bson@2.15.0 -
What version of MongoDB are you using? (Check with the MongoDB shell using
db.version())
MongoDB 8.0.16 Community -
What is your MongoDB topology (standalone, replica set, sharded cluster, serverless)?
Replica Set
Describe the bug
We are using managed mongodb service from Aliyun. When we try to connect using mongo+srv with ssl=false, the dns-resolver doesnt seem to be able to resolve it. But the exact same uri works in MongoDB Compass & nodejs mongo driver. I am curious if rust driver requires +srv to work with ssl=true only?
If I switch to use mongo:// + multipls hosts. It is working as expected.
To Reproduce
- Connect DB
let uri = "mongodb+srv://xxx:yyy@zzz.mongodb.singapore.nosql.aliyuncs.com/testdb?ssl=false&retryWrites=true&w=majority&readPreference=secondaryPreferred"
let client = Client::with_uri_str(uri)
.await
.map_err(|e| DomainError::DatabaseError(e.to_string()))?;
-
cargo run
-
Error
Error: DatabaseError("Kind: An error occurred during DNS resolution: proto error: request timed out, labels: {}, source: None, server response: None")