From 7840059d8d31a4142ee5c667bca19501c6d2e279 Mon Sep 17 00:00:00 2001
From: Julien Dessaux
Date: Thu, 3 Nov 2011 18:52:20 +0100
Subject: Taking advantage of the new TLS debugging capabilities

---
 Hsbot/Config.hs | 3 ++-
 Hsbot/Types.hs  | 3 ++-
 Hsbot/Utils.hs  | 4 +++-
 3 files changed, 7 insertions(+), 3 deletions(-)

(limited to 'Hsbot')

diff --git a/Hsbot/Config.hs b/Hsbot/Config.hs
index 6053e9e..b8dad68 100644
--- a/Hsbot/Config.hs
+++ b/Hsbot/Config.hs
@@ -33,7 +33,8 @@ defaultTLSConfig = TLSConfig
                     , cipher_AES256_SHA1
                     , cipher_AES128_SHA256
                     , cipher_AES256_SHA256 ]
-    , sslVerify   = True }
+    , sslVerify   = True
+    , sslLogging  = defaultLogging }
 
 noSSL :: TLSConfig
 noSSL = defaultTLSConfig { sslOn = False }
diff --git a/Hsbot/Types.hs b/Hsbot/Types.hs
index b0110c2..3201caf 100644
--- a/Hsbot/Types.hs
+++ b/Hsbot/Types.hs
@@ -93,5 +93,6 @@ data TLSConfig = TLSConfig
     , sslVersions :: [Network.TLS.Version]
     , sslCiphers  :: [Network.TLS.Cipher]
     , sslVerify   :: Bool
-    } deriving (Show)
+    , sslLogging  :: TLSLogging
+    }
 
diff --git a/Hsbot/Utils.hs b/Hsbot/Utils.hs
index d29345c..93bb64d 100644
--- a/Hsbot/Utils.hs
+++ b/Hsbot/Utils.hs
@@ -64,6 +64,8 @@ initTLSEnv :: TLSConfig -> IO TLSParams
 initTLSEnv ssl = do
     let versions = sslVersions ssl
         ciphers  = sslCiphers ssl
+        logging  = sslLogging ssl
     return $ defaultParams { pAllowedVersions = versions
-                           , pCiphers = ciphers }
+                           , pCiphers = ciphers
+                           , pLogging = logging }
 
-- 
cgit v1.2.3