Question

I used to connect to a mongo server with:

connection = pymongo.MongoClient(host,int(port))

However, we recently installed individual keyfile security in accessing the database. I have consulted documentation here, and in other examples, and it looks like the right way to include that should be:

connection = pymongo.MongoClient(host,int(port), ssl=True, ssl_keyfile="/.ssh/mykeyfile")

However, trying either the ssl_keyfile or ssl_certificate flags both return

pymongo.errors.ConfigurationError: Unknown option ssl_certfile
pymongo.errors.ConfigurationError: Unknown option ssl_keyfile

How can I add this parameter to connect with keyfile authentication? I am puzzled that this item that is specified clearly in the documentation is throwing this error.

No correct solution

OTHER TIPS

Which version of pymongo are you running?

The SSL options were added in 2.5, and works here (I'm using 2.6.3). Referring to the doc you linked:

Changed in version 2.5: Added additional ssl options

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top