pma/amqp

AMQP.Connection doesn't pick the default SSL configuration

ggcampinho opened this issue · 1 comments

We are using :broadway_rabbitmq and the config in runtime.exs is similar to the one below, working perfectly.

config :amqp, connection: [url: "amqp://guest:guest@myhost:12345"]

The issue was after migrating to an amqps connection that required SSL and I changed the config to:

config :amqp, connection: [url: "amqp://guest:guest@myhost:12345", ssl_options: [...]]

The application would crash with:

[error] Cannot connect to RabbitMQ broker: {:options, :incompatible, [verify: :verify_peer, cacerts: :undefined]}

After some digging into the application, I found that the correct configuration would be:

config :amqp, connection: [url: "amqp://guest:guest@myhost:12345"]
config :amqp_client, ssl_options: [...]

It seems that AMQP.Connection doesn't pass the SSL config down to :amqp_client.

ono commented

Broadway uses AMQP.Connection.open directly and passes the connection string there. This means config :amqp, connection would be ignored.

You can set the SSL option in Broadway's options. Please see this page and configure :connection option there.

Thanks!