@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE OverloadedStrings #-}
23{-# LANGUAGE RankNTypes #-}
34{-# LANGUAGE RecordWildCards #-}
@@ -46,6 +47,9 @@ import Crypto.Random.AESCtr (makeSystem)
4647import Control.Exception (Exception, throwIO)
4748import Data.Typeable (Typeable)
4849import qualified Data.Conduit.Binary as CB
50+#if MIN_VERSION_tls(1, 1, 3)
51+import qualified Crypto.Random.AESCtr
52+#endif
4953
5054data TLSSettings = TLSSettings
5155 { certFile :: FilePath
@@ -117,7 +121,11 @@ runTLSSocket TLSSettings {..} set sock app = do
117121 return bs
118122 if maybe False ((== 0x16) . fst) (firstBS >>= B.uncons)
119123 then do
124+#if MIN_VERSION_tls(1, 1, 3)
125+ gen <- Crypto.Random.AESCtr.makeSystem
126+#else
120127 gen <- makeSystem
128+#endif
121129 ctx <- TLS.contextNew
122130 TLS.Backend
123131 { TLS.backendFlush = return ()