vsivsi / meteor-file-collection

Extends Meteor Collections to handle file data using MongoDB gridFS.
http://atmospherejs.com/vsivsi/file-collection
Other
159 stars 37 forks source link

File-collection SSL connection to MongoDB 3.2 #96

Open snajjar opened 8 years ago

snajjar commented 8 years ago

Hello,

File-collection is not supporting the ssl option parameter (set to true) in the MONGO_URL.

mongodb://user:password@example.com:10000/database?ssl=true

It gives the following error:

(STDERR) Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
(STDERR)     at Object.Future.wait (/home/home/seb/.meteor/packages/meteor-tool/.1.1.10.ki0ccv++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:398:15)
(STDERR)     at packages/meteor/helpers.js:119:1
(STDERR)     at new FileCollection (packages/vsivsi_file-collection/src/gridFS_server.coffee:35:16)

After a little web crawling, it seems that the NODE_TLS_REJECT_UNAUTHORIZED env variable is able to "solve" (in a unsatisfying insecure way) the issue, but it didn't work for me.

Should it be working today? And if not, is the development planned? Please take into account that the issue was observed with the MongoDB 3.2, so it may be related. I'll try on a lower version as soon as i can.

vsivsi commented 8 years ago

At first glance, this looks like another Meteor + Mongo3.2 issue. I think it is the Meteor Collection connection to the DB that is failing, not the one that file-collection maintains for itself. Unfortunately they both need to work correctly! This is precisely the kind of issue I suspected might arise with trying to use Mongo 3.2 with Meteor until MDG updates the Meteor mongodb driver to 2.1.x.

snajjar commented 8 years ago

I've tested this with the mongo32_test branch, i'm still getting this error.

vsivsi commented 8 years ago

Okay, thanks for the update. I'll keep this open until MDG resolves the outdated driver issue on their end.

bjornba commented 7 years ago

Should this be solved now with the release of Meteor 1.4?

I'm getting this error using Meteor 1.4.1.1 with mongodb 3.2

 throw(ex);
Error: unable to verify the first certificate
    at Object.Future.wait (/home/vcap/app/bundle/programs/server/node_modules/fibers/future.js:449:15)
    at packages/meteor/helpers.js:119:1
    at new FileCollection (packages/vsivsi_file-collection/src/gridFS_server.coffee:35:16)
    at meteorInstall.model.attachments.js (model/attachments.js:2:15)
    at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
    at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
    at /home/vcap/app/bundle/programs/server/app/app.js:6391:1
    at /home/vcap/app/bundle/programs/server/boot.js:292:10
    at Array.forEach (native)
    at Function._.each._.forEach (/home/vcap/app/bundle/programs/server/node_modules/underscore/underscore.js:79:11)
    - - - - -
    at Error (native)
    at emitNone (events.js:67:13)
    at TLSSocket.emit (events.js:166:7)
    at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:428:38)

Instance (index 0) failed to start accepting connections
vsivsi commented 7 years ago

Hi, I don't know if Meteor updated the Mongo driver in this release. Do you have information that they did?

bjornba commented 7 years ago

Yes, according to their changelog they updated it to version 2.2.8 in Meteor 1.4.1.1

vsivsi commented 7 years ago

Okay, I'll look into it. Might be early next week before I get the chance though.

OldCarlosCueto commented 7 years ago

Any chance of solving this or working around it? I'm stuck with the same error.

vsivsi commented 7 years ago

@CarlosCuetoM I'll look into this before next week.