Skip to content

fix: rebuild libmongoc with SecureTransport for MongoDB Atlas TLS#485

Merged
datlechin merged 3 commits intomainfrom
fix/mongodb-tls-securetransport
Mar 28, 2026
Merged

fix: rebuild libmongoc with SecureTransport for MongoDB Atlas TLS#485
datlechin merged 3 commits intomainfrom
fix/mongodb-tls-securetransport

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • MongoDB Atlas connections via mongodb+srv:// failed with "TLS handshake failed: certificate verify failed" because libmongoc was built with statically-linked OpenSSL that had no default CA certificate bundle
  • Rebuilt libmongoc with -DENABLE_SSL=DARWIN (SecureTransport) instead of OpenSSL, so TLS certificate verification uses the macOS system Keychain automatically
  • Removed OpenSSL build step from build-libmongoc.sh (no longer needed — libssh2 has its own separate build script)
  • Updated MongoDB plugin linker flags: replaced -lssl -lcrypto with -framework Security -framework CoreFoundation

Test plan

  • MongoDB Atlas connection via mongodb+srv:// URI succeeds without providing CA cert
  • MongoDB local connection without TLS still works
  • SSH tunnel connections still work (uses separate OpenSSL from libssh2)
  • Build succeeds for both Debug and Release

@datlechin datlechin merged commit 923e8e4 into main Mar 28, 2026
2 checks passed
@datlechin datlechin deleted the fix/mongodb-tls-securetransport branch March 28, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant