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

:port required with :ssl true #114

Closed
vincentjames501 opened this issue Oct 4, 2022 · 1 comment · Fixed by #115
Closed

:port required with :ssl true #114

vincentjames501 opened this issue Oct 4, 2022 · 1 comment · Fixed by #115

Comments

@vincentjames501
Copy link

Calling

(langohr.core/connect {:host "localhost" :ssl true})

Will fail if tls is enabled on the broker. It looks like the intention of the code was to use ConnectionFactory/DEFAULT_AMQP_OVER_SSL_PORT when :ssl is supplied, however, due to the call to normalize-settings, it will set :port to 5672 which when building the addresses to connect to will cause (get settings' :port default-port) to never return the default-port as it seems like was the intention:

settings'             (normalize-settings settings)
...
xs                    (address-array-from (get settings' :hosts #{})
                                                            (get settings' :port default-port))

You can get around this by manually supplying :port to the connection map but it was a bit of a gotcha as it was clearly trying to do ssl, the connection factory has the correct port defined, etc, but it was ultimately trying to connect on the non tls endpoint.

@michaelklishin
Copy link
Owner

Please submit a PR?

vincentjames501 pushed a commit to vincentjames501/langohr that referenced this issue Oct 4, 2022
vincentjames501 pushed a commit to vincentjames501/langohr that referenced this issue Oct 4, 2022
@michaelklishin michaelklishin mentioned this issue Nov 24, 2022
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

Successfully merging a pull request may close this issue.

2 participants