From a0b4bf70d9238778cf91a93bf9b384a17a0199fb Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Thu, 23 Nov 2023 10:10:21 -0500 Subject: [PATCH] Make sure final-port in langohr.core/open is defined --- src/clojure/langohr/core.clj | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/clojure/langohr/core.clj b/src/clojure/langohr/core.clj index c7c4b75..3408030 100644 --- a/src/clojure/langohr/core.clj +++ b/src/clojure/langohr/core.clj @@ -329,9 +329,14 @@ cf (ConnectionFactory.) final-properties (cond-> client-properties connection-name (assoc "connection_name" connection-name) - update-client-properties update-client-properties)] - (when (or ssl - (= port ConnectionFactory/DEFAULT_AMQP_OVER_SSL_PORT)) + update-client-properties update-client-properties) + tls-expected (or ssl + (not (nil? ssl-context)) + (= port ConnectionFactory/DEFAULT_AMQP_OVER_SSL_PORT)) + final-port (or port (if tls-expected + ConnectionFactory/DEFAULT_AMQP_OVER_SSL_PORT + ConnectionFactory/DEFAULT_AMQP_PORT))] + (when tls-expected (.useSslProtocol cf)) (doto cf (.setClientProperties final-properties)