Created
October 9, 2014 15:54
-
-
Save ajcrites/09bb0c257caac8d42b04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Connect to a Mongo replica set using SSL through Mongoose and the power of love | |
var db = { | |
dsn: 'mongodb://db1:27017/DB_NAME,mongodb://db2:27017/DB_NAME,mongodb:db3:27017/DB_NAME', | |
options: { | |
replset: { | |
rs_name: 'rs0', | |
ssl: true, | |
sslCert: fs.readFileSync("/path/to/file.crt"), | |
sslKey: fs.readFileSync("/path/to/file.key"), | |
}, | |
auth: { authdb: "AUTH_DB_NAME" }, | |
user: "username", | |
pass: "********", | |
}, | |
}; | |
mongoose.connect(db.dsn, db.options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment