warp-tls 1.4.2 → 2.0.0
raw patch · 2 files changed
+12/−8 lines, 2 filesdep ~waidep ~warp
Dependency ranges changed: wai, warp
Files
- Network/Wai/Handler/WarpTLS.hs +9/−5
- warp-tls.cabal +3/−3
Network/Wai/Handler/WarpTLS.hs view
@@ -43,13 +43,13 @@ import Data.Conduit.Network (sourceSocket, sinkSocket, acceptSafe) import Data.Maybe (fromMaybe) import qualified Data.IORef as I-import Crypto.Random.AESCtr (makeSystem) import Control.Exception (Exception, throwIO) import Data.Typeable (Typeable) import qualified Data.Conduit.Binary as CB #if MIN_VERSION_tls(1, 1, 3) import qualified Crypto.Random.AESCtr #endif+import Network.Wai.Handler.Warp.Buffer data TLSSettings = TLSSettings { certFile :: FilePath@@ -150,25 +150,29 @@ params gen TLS.handshake ctx+ buf <- allocateBuffer bufferSize+ blazeBuf <- toBlazeBuffer buf bufferSize let conn = Connection { connSendMany = TLS.sendData ctx . L.fromChunks , connSendAll = TLS.sendData ctx . L.fromChunks . return- , connSendFile = \fp offset len _th headers _cleaner -> do+ , connSendFile = \fp offset len _th headers -> do TLS.sendData ctx $ L.fromChunks headers C.runResourceT $ sourceFileRange fp (Just offset) (Just len) C.$$ CL.mapM_ (TLS.sendData ctx . L.fromChunks . return) , connClose = TLS.bye ctx `finally` TLS.contextClose ctx , connRecv = TLS.recvData ctx+ , connSendFileOverride = NotOverride+ , connBuffer = blazeBuf } return conn else case onInsecure of- AllowInsecure ->- let conn = (socketConnection s)+ AllowInsecure -> do+ conn' <- socketConnection s+ return conn' { connRecv = getNext $ fmap (fromMaybe B.empty) C.await }- in return conn DenyInsecure lbs -> do let src = do C.yield "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\n"
warp-tls.cabal view
@@ -1,5 +1,5 @@ Name: warp-tls-Version: 1.4.2+Version: 2.0.0 Synopsis: HTTP over SSL/TLS support for Warp via the TLS package License: MIT License-file: LICENSE@@ -18,8 +18,8 @@ Library Build-Depends: base >= 4 && < 5 , bytestring >= 0.9- , wai >= 1.3 && < 1.5- , warp >= 1.3.5 && < 1.4+ , wai >= 2.0 && < 2.1+ , warp >= 2.0 && < 2.1 , transformers >= 0.2 , conduit >= 0.5 && < 1.1 , network-conduit >= 0.6 && < 1.1