Switch MongoCredential method

Update MongoProperties to use `MongoCredential.createCredential` rather
than `MongoCredential.createMongoCRCredential`. This allows connections
to Mongo 3.0 servers to authenticate using the SCRAM-SHA-1 mechanism.

Closes gh-4237
pull/4409/merge
awgtek 9 years ago committed by Phillip Webb
parent d5d6507e97
commit deaa9051bc

@ -217,8 +217,8 @@ public class MongoProperties {
if (hasCustomCredentials()) {
String database = this.authenticationDatabase == null
? getMongoClientDatabase() : this.authenticationDatabase;
credentials = Arrays.asList(MongoCredential.createMongoCRCredential(
this.username, database, this.password));
credentials = Arrays.asList(MongoCredential
.createCredential(this.username, database, this.password));
}
String host = this.host == null ? "localhost" : this.host;
int port = determinePort(environment);

Loading…
Cancel
Save