Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- MongoDB Atlas connections failing to authenticate (#438)
- MongoDB TLS certificate verification skipped for SRV connections

## [0.23.1] - 2026-03-24

### Added
Expand Down
5 changes: 3 additions & 2 deletions Plugins/MongoDBDriverPlugin/MongoDBConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ final class MongoDBConnection: @unchecked Sendable {
let effectiveAuthSource: String
if let source = authSource, !source.isEmpty {
effectiveAuthSource = source
} else if useSrv {
effectiveAuthSource = "admin"
} else if !database.isEmpty {
effectiveAuthSource = database
} else {
Expand All @@ -206,8 +208,7 @@ final class MongoDBConnection: @unchecked Sendable {
let sslEnabled = ["Preferred", "Required", "Verify CA", "Verify Identity"].contains(sslMode)
if sslEnabled {
params.append("tls=true")
let verifiesCert = sslMode == "Verify CA" || sslMode == "Verify Identity"
if !verifiesCert {
if sslMode == "Preferred" {
params.append("tlsAllowInvalidCertificates=true")
}
if !sslCACertPath.isEmpty {
Expand Down
Loading