Skip to content

Commit

Permalink
fix :ssl-options handling
Browse files Browse the repository at this point in the history
prior to this commit it didn't work at all
instance? args were reversed
Builder instance was returned rather than SSLOptions

now it works (tested with a jks keystore)
  • Loading branch information
blak3mill3r committed Apr 12, 2016
1 parent 32399e1 commit 0bbcfb7
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions modules/alia/src/qbits/alia/cluster_options.clj
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
(defmethod set-cluster-option! :ssl-options
[_ ^Cluster$Builder builder ssl-options]
(.withSSL builder
(if (instance? ssl-options SSLOptions)
(if (instance? SSLOptions ssl-options)
ssl-options
(let [{:keys [keystore-path keystore-password cipher-suites]} ssl-options
keystore (KeyStore/getInstance "JKS")
Expand All @@ -247,14 +247,13 @@
(.init ssl-context
(.getKeyManagers keymanager)
(.getTrustManagers trustmanager) nil)
(doto (JdkSSLOptions/builder)
(.build)
(.withCipherSuites ^Builder (into-array String
(if cipher-suites
cipher-suites
["TLS_RSA_WITH_AES_128_CBC_SHA"
"TLS_RSA_WITH_AES_256_CBC_SHA"])))
(.withSSLContext ssl-context))))))
(.build (doto (JdkSSLOptions/builder)
(.withCipherSuites ^Builder (into-array String
(if cipher-suites
cipher-suites
["TLS_RSA_WITH_AES_128_CBC_SHA"
"TLS_RSA_WITH_AES_256_CBC_SHA"])))
(.withSSLContext ssl-context)))))))

(defmethod set-cluster-option! :timestamp-generator
[_ ^Cluster$Builder builder ts-generator]
Expand Down

0 comments on commit 0bbcfb7

Please sign in to comment.