Skip to content

Commit

Permalink
Use old MongoAuthMechanism if explcitly stated
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Jan 10, 2018
1 parent 440424e commit 7273713
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 7273713

Please sign in to comment.