From eb8fc654ec350d17f2ebc8164c9e6e70adc29d28 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 10 Apr 2012 18:26:47 +0200 Subject: Make XMPP settings more configurable. --- config.sexp.sample | 2 ++ src/mulk/benki/xmpp.clj | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config.sexp.sample b/config.sexp.sample index f314815..bebb7d0 100644 --- a/config.sexp.sample +++ b/config.sexp.sample @@ -15,6 +15,8 @@ :server "jabber.example.com" :port 5222 :password "" + :sasl true + :verify-cert true :tls :required} ;or one of: true, false } diff --git a/src/mulk/benki/xmpp.clj b/src/mulk/benki/xmpp.clj index 4f967ba..74c4933 100644 --- a/src/mulk/benki/xmpp.clj +++ b/src/mulk/benki/xmpp.clj @@ -32,10 +32,10 @@ true ConnectionConfiguration$SecurityMode/enabled false ConnectionConfiguration$SecurityMode/disabled :required ConnectionConfiguration$SecurityMode/required)) - (.setVerifyRootCAEnabled true) - (.setVerifyChainEnabled true) + (.setVerifyRootCAEnabled (:verify-cert xmpp-config)) + (.setVerifyChainEnabled (:verify-cert xmpp-config)) ;;(.setCompressionEnabled true) - (.setSASLAuthenticationEnabled true))] + (.setSASLAuthenticationEnabled (:sasl xmpp-config)))] (doto (XMPPConnection. connection-config) (.connect) (.login (:user xmpp-config) (:password xmpp-config) (:resource xmpp-config))))) -- cgit v1.2.3