EnterpriseDB / mongo_fdw

PostgreSQL foreign data wrapper for MongoDB
GNU Lesser General Public License v3.0
330 stars 70 forks source link

Authentication with ssl #68

Closed GaelMagnan closed 7 years ago

GaelMagnan commented 8 years ago

Hi,

I'm trying to use this FDW to connect to a mongodb server that requires ssl with self signed certificates.

I compiled the meta driver with --enable-ssl

Since there is no option to give it to the driver I digged in the code and passed my read_preference as 'primary&ssl=true' which should work (even if it's definitely not my preferred way of doing).

But since there is no way to pass the --sslAllowInvalidCertificates flag through the URL that I know of I can't do it that way. Is there a way to add support of the ssl option?

The driver itself seems to handle it: http://mongoc.org/libmongoc/current/mongoc_ssl_opt_t.html

GaelMagnan commented 8 years ago

I've offered a PR: https://github.com/EnterpriseDB/mongo_fdw/pull/69