Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: unable to verify the first certificate #331

Closed
igorissen opened this issue Feb 24, 2017 · 4 comments
Closed

ERROR: unable to verify the first certificate #331

igorissen opened this issue Feb 24, 2017 · 4 comments

Comments

@igorissen
Copy link

igorissen commented Feb 24, 2017

Hi,

Trying to connect to a RabbitMQ server on a service called Compose.com and I keep getting this error message:

Error: unable to verify the first certificate
        at Error (native)
        at TLSSocket.<anonymous> (_tls_wrap.js:1079:38)
        at emitNone (events.js:86:13)
        at TLSSocket.emit (events.js:185:7)
        at TLSSocket._finishInit (_tls_wrap.js:603:8)
        at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)

This an example of the connection string that Compose give me

amqps://[username]:[password]@portal.example.com:11111/vhostname

You can see that on each examples you use amqp://. Is the module handle the secure version of the protocol amqps:// ?

And you can find here the module created to handle connection and a few methods.

Any idea how to fix that ?

Thank you.

@igorissen
Copy link
Author

Found a solution with the help of Compose helpdesk using this.

const url = require('url');

const uri = 'amqp://localhost' // or amqps://.........
const parsedURI = url.parse(uri);

amqp.connect(uri, { servername: parsedURI.hostname })

Works with amqp:// and amqps://.

You can check my code for the changes

@diogosantosmendes
Copy link

@igorissen love you

@squaremo
Copy link
Collaborator

squaremo commented Jun 5, 2018

@diogosantosmendes Did the solution work for you? It's been reported as not working (any more), elsewhere (#371).

@salimakhtar92
Copy link

I am getting following erroe

Exception while invoking method 'serverLogin' Error: unable to verify the first certificate
I20180812-22:11:35.569(5.5)?     at Object.Future.wait (/home/salim/.meteor/packages/meteor-tool/.1.4.3_1.1k6vv31.onjf++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:449:15)
I20180812-22:11:35.570(5.5)?     at Object.call (packages/meteor.js:213:24)
I20180812-22:11:35.570(5.5)?     at [object Object].Meteor.methods.serverLogin (imports/accounts/api/loginmethod.js:8:15)
I20180812-22:11:35.571(5.5)?     at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1737:12)
I20180812-22:11:35.571(5.5)?     at packages/ddp-server/livedata_server.js:719:19
I20180812-22:11:35.572(5.5)?     at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
I20180812-22:11:35.572(5.5)?     at packages/ddp-server/livedata_server.js:717:40
I20180812-22:11:35.572(5.5)?     at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
I20180812-22:11:35.573(5.5)?     at packages/ddp-server/livedata_server.js:715:46
I20180812-22:11:35.573(5.5)?     at [object Object]._.extend.protocol_handlers.method (packages/ddp-server/livedata_server.js:689:23)
I20180812-22:11:35.574(5.5)?     - - - - -
I20180812-22:11:35.574(5.5)?     at Error (native)
I20180812-22:11:35.574(5.5)?     at TLSSocket.<anonymous> (_tls_wrap.js:1039:38)
I20180812-22:11:35.575(5.5)?     at emitNone (events.js:67:13)
I20180812-22:11:35.575(5.5)?     at TLSSocket.emit (events.js:166:7)
I20180812-22:11:35.575(5.5)?     at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:603:8)
I20180812-22:11:35.576(5.5)?     at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:445:38)

My method:

import { Meteor } from 'meteor/meteor';

Meteor.methods({
	'serverLogin': function(email, password){
		
		let path =`https://www.XYZ.com/login/token/${email}/${password}`;
		return HTTP.call('GET', path);
	},
});

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

No branches or pull requests

4 participants