mateodelnorte / servicebus

Simple service bus for sending events between processes using amqp.
MIT License
420 stars 66 forks source link

Pass implOpts to amqplib.connect #86

Closed allenhartwig closed 7 years ago

allenhartwig commented 7 years ago

The implOpts parameter was not getting consumed and passed to the amqplib.connect method. The inability to pass in options to connect was prohibiting amqps connections that require a {servername} option.

mateodelnorte commented 7 years ago

thanks! merged and published to servicebus@2.0.7

mateodelnorte commented 7 years ago

By the way, what is your reason for passing in servername as part of the implOptions parameter to connect?

I've always seen servername included as part of the rmq url. implOptions should probably be renamed to socketOptions. That variable name is a hold over from when servicebus used node-amqp (which I moved off of due to their channel implementation).

Here are the properties available on socketOptions: http://www.rabbitmq.com/networking.html#socket-gen-tcp-options

allenhartwig commented 7 years ago

We had switched to compose.com as a amqp-as-a-service provider, and we were unable to connect without receiving the error Error: unable to verify the first certificate without explicitly passing {servername} in the options parameter of .connect, as they illustrated in their example: https://github.com/compose-ex/rabbitmqconns/blob/master/node/rabbitmqconnssl.js#L16

Perhaps this could also be accomplished via socket options, but I wasn't aware of that potential path and have not tested it.