-
Notifications
You must be signed in to change notification settings - Fork 25
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
AMQPS Support #77
Comments
Assuming type remains amqp, I'm getting the following error when trying to connect with AMPQS:
|
@nfantone thanks. Not sure how I missed the socket options :/ Anyway - I'm getting those errors when trying to connect to a compose.io rabbitmq host that uses AMQPS with letsencrypt certificates. I assumed this would work as is, or at most require me to add the root CA and/or intermediary CAs for letsencrypt. Nothing seems to make a difference though. Any ideas? |
@nfantone I just tested and can connect fine when using amqplib, but not with this module. Any idea why this could be interfering with SSL connections? |
@seonixx That is odd. Would you mind sharing some code snippets on how you are connecting with both, please? Also, are you using latest versions for this transport and |
@nfantone Sure. Working (based on example from amqplib docs):
Getting various certificate errors when connecting with this module as follows (for example):
|
@nfantone - using amqplib 0.5.1 and seneca-amqp-transport 2.1.0. |
@seonixx Sorry, I'm a bit busy today. Didn't find the time to try your code. Meanwhile, could you do me a favor? Could you try connecting using latest on |
@nfantone Tried connecting with latest on develop. Same issue unfortunately :( |
@seonixx I just ran the Could you try doing the same with your endpoint, please? Just clone the repo and from its directory, execute: AMQP_URL=amqps://[username]:[password]@[hostname]:15846/mq node examples/listener.js This will create a |
Another thing you can do is read and follow the amqplib guide on SSL. It even provides actions for common errors. Also, if you are using self-signed certificates, try setting the env var process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; in your script before connecting or by setting its value in the terminal before running it: NODE_TLS_REJECT_UNAUTHORIZED=0 node your-script.js |
@nfantone when you say you ran it over AMQPS and it worked fine, what kind of certificates were you using? Self signed? I'm using a hosted compose.io instance that uses letsencrypt certificates. I get the same error testing with the listener, however it works with Like I said it works fine on amqplib without designating any additional root or intermediary CAs so there must be something different with how this module is handling or parsing certificates. Any ideas? Thanks for your help so far. |
@seonixx Ok, so this is evidently a certificate validation issue. To be completely honest with you, I don't understand how your
AFAIK, under any other circumstance, you must provide, at least, a
An Amazon AWS hosted RabbitMQ instance using a Comodo root CA. This authority is well known and comes installed in most OS nowadays. If you are using macOS, you can check what CAs are installed by default by pointing your browser to Would you corroborate that your "lestencrypt" CA is under there (it wasn't in my macOS Sierra)? If it is, then there's definitely something odd with the transport. If it's not, then we are going to need to ask @squaremo about |
@nfantone OK I worked out the issue finally. A bit of background... Letsencrypt issues a server certificate that you verify against ISRG Root X1 CA which is why generally you need dont need to add any additional CAs as most OS/browsers would have this CA installed and trusted by default. I did a test on the TLS connection and saw something interesting in regards to the issuer of the certificate so I got in touch with compose.io:
You'd expect the issuer to be LetsEncrypt. Now the issue was that you have to pass a servername parameter when using letsencrypt, and amqplib doesn't parse this for you. If you see the amqplib example above, it passes this in the options. My faulty example did not pass the servername in the options. As soon as I added the servername option it worked fine. Thanks for your time and apologies for not picking up the issue earlier :( |
@seonixx Glad to see that you could resolve the issue in the end. Feel free to open another one if something else comes up. |
I'm trying to connect to a hosted amqp provider that mandates AMQPS be used. Does this module support AMPQS and if so, is there an example of a working connection?
The text was updated successfully, but these errors were encountered: