Skip to content

Commit

Permalink
Merge pull request vibe-d#2027 from wilzbach/fix-1967
Browse files Browse the repository at this point in the history
Use old MongoAuthMechanism if explictly stated
merged-on-behalf-of: Sebastian Wilzbach <[email protected]>
  • Loading branch information
dlang-bot authored Feb 23, 2018
2 parents 71b12e8 + 7f00d12 commit 92a5be9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mongodb/vibe/db/mongo/connection.d
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ final class MongoConnection {
m_bytesRead = 0;
if(m_settings.digest != string.init)
{
if (m_settings.authMechanism == MongoAuthMechanism.none)
authenticate();
if (m_settings.authMechanism == MongoAuthMechanism.mongoDBCR)
authenticate(); // use old mechanism if explicitly stated
else {
/**
SCRAM-SHA-1 was released in March 2015 and on a properly
Expand All @@ -194,9 +194,9 @@ final class MongoConnection {
no authentication is tried in case of an error.
*/
try
scramAuthenticate();
scramAuthenticate(); // scram-sha-1 is default in version v3.0+
catch (MongoAuthException e)
authenticate();
authenticate(); // fall back if scram-sha-1 fails
}

}
Expand Down

0 comments on commit 92a5be9

Please sign in to comment.