taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.15k stars 130 forks source link

ssl-fn does not default to :default when omitted #218

Closed Tebro closed 4 years ago

Tebro commented 5 years ago

When setting up the spec for a connection to Redis that uses SSL the ssl-fn option is not optional / does not default to :default.

ptaoussanis commented 5 years ago

Hi there,

Sorry, only have a minute to look at this and not sure I understand- could you please clarify what the current+expected behaviour is? Thanks!

ptaoussanis commented 4 years ago

Closing due to inactivity, please feel free to re-open if someone's interested in following up 👍

danielytics commented 3 years ago

I believe what was meant is that this:

(def server1-conn {:spec {:uri "rediss://<redis-connection-uri>"}}) 

is not the same as this:

(def server1-conn {:spec {:uri "rediss://<redis-connection-uri>"
                          :ssl-fn :default}})

That is, you must explicitly set ssl-fn to :default. That you are using SSL is not detected from the rediss protocol in the URI.

ptaoussanis commented 3 years ago

Thanks @danielytics 👍

To clarify then: the current behaviour is as intended, and is correctly documented in the wcar macro:

Optional `ssl-fn` conn opt takes and returns a `java.net.Socket`:
    (fn [{:keys [^Socket socket host port]}]) -> ^Socket
    `:default` => use `taoensso.carmine.connections/default-ssl-fn`.

"default" in this context doesn't imply it's enabled by default, it's just the default ssl fn if you want ssl (which is optional).

Hope that helps!