Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Support for extra_opts in connection string (like {:ssl => true, :... => ...}) #42

Closed
ghost opened this issue Oct 11, 2012 · 1 comment
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Oct 11, 2012

Since we run all our MongoDB instances with SSL it would be nice, if there is a possibility to specify these extra_options in the connection string:

http://docs.mongodb.org/manual/administration/ssl/

Since genghis uses Mongo::Connection.from_uri this should be an easy task ;-)

http://www.rubydoc.info/github/mongodb/mongo-ruby-driver/master/Mongo/Connection#from_uri-class_method

Connection options and extra options of the mongo driver (GENERIC_OPTS and CONNECTION_OPTS):

http://api.mongodb.org/ruby/current/Mongo/Connection.html

Example of a working connection string:

con = Mongo::Connection.from_uri('mongodb://dummy:pass4dummy@db1.dev.example.org/admin', :ssl => true)

Thanks for this great app!

@bobthecow
Copy link
Owner

Support for ssl has been added to the develop branch. Check it out and let me know if anything's broken :)

A style note: since the server URIs use the standard Mongo connection string format, I'm expecting the query param style rather than the ruby opt style names. For example, you would use connectTimeoutMS rather than :connection_timeout.

Genghis (.rb) currently only supports replicaSet, connectTimeoutMS and ssl. All queries are done with safe, so that option doesn't make sense to set at the server level. I don't want to support slaveOkay (at least until Genghis supports read-only users, but possibly ever). If you need to connect to a slave, just connect directly to the slave...

The rest of the options seem to be unsupported at the connection level by the Ruby driver, so they'll take a bit more to integrate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant