meteor-file-collection icon indicating copy to clipboard operation
meteor-file-collection copied to clipboard

File-collection SSL connection to MongoDB 3.2

Open snajjar opened this issue 8 years ago • 9 comments

Hello,

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

mongodb://user:[email protected]: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.

snajjar avatar Mar 25 '16 23:03 snajjar

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.

vsivsi avatar Mar 26 '16 22:03 vsivsi

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

snajjar avatar Apr 11 '16 13:04 snajjar

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

vsivsi avatar Apr 11 '16 22:04 vsivsi

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

bjornba avatar Sep 12 '16 17:09 bjornba

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

vsivsi avatar Sep 15 '16 22:09 vsivsi

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

bjornba avatar Sep 15 '16 22:09 bjornba

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

vsivsi avatar Sep 15 '16 23:09 vsivsi

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

OldCarlosCueto avatar Apr 05 '17 11:04 OldCarlosCueto

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

vsivsi avatar Apr 05 '17 17:04 vsivsi