@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE OverloadedStrings #-}
23{-# LANGUAGE RankNTypes #-}
34{-# LANGUAGE RecordWildCards #-}
@@ -266,8 +267,12 @@ mkConn tlsset s params = do
266267
267268httpOverTls :: TLS.TLSParams params => TLSSettings -> Socket -> I.IORef B.ByteString -> params -> IO (Connection, Transport)
268269httpOverTls TLSSettings{..} s cachedRef params = do
270+#if MIN_VERSION_tls(1,3,0)
271+ ctx <- TLS.contextNew backend params
272+#else
269273 gen <- Crypto.Random.AESCtr.makeSystem
270274 ctx <- TLS.contextNew backend params gen
275+#endif
271276 TLS.contextHookSetLogging ctx tlsLogging
272277 TLS.handshake ctx
273278 readBuf <- allocateBuffer bufferSize