warp-tls 3.1.5 → 3.2.0
raw patch · 2 files changed
+10/−32 lines, 2 filesdep ~waidep ~warp
Dependency ranges changed: wai, warp
Files
- Network/Wai/Handler/WarpTLS.hs +7/−29
- warp-tls.cabal +3/−3
Network/Wai/Handler/WarpTLS.hs view
@@ -35,8 +35,6 @@ -- * Runner , runTLS , runTLSSocket- , runHTTP2TLS- , runHTTP2TLSSocket -- * Exception , WarpTLSException (..) ) where@@ -60,7 +58,6 @@ import qualified Network.TLS as TLS import qualified Network.TLS.Extra as TLSExtra import Network.Wai (Application)-import Network.Wai.HTTP2 (HTTP2Application) import Network.Wai.Handler.Warp import Network.Wai.Handler.Warp.Internal import System.IO.Error (isEOFError)@@ -221,39 +218,20 @@ ---------------------------------------------------------------- --- Composition over two arguments at once; used for runHTTP2\*.-(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d-f .: g = curry $ f . uncurry g- -- | Running 'Application' with 'TLSSettings' and 'Settings'. runTLS :: TLSSettings -> Settings -> Application -> IO ()-runTLS tset set = runServeTLS tset set . serveDefault---- | Run an HTTP\/2-aware server with 'TLSSettings' and 'Settings'.-runHTTP2TLS :: TLSSettings -> Settings -> HTTP2Application -> Application -> IO ()-runHTTP2TLS tset set = runServeTLS tset set .: serveHTTP2--runServeTLS :: TLSSettings -> Settings -> ServeConnection -> IO ()-runServeTLS tset set serve = withSocketsDo $+runTLS tset set app = withSocketsDo $ bracket (bindPortTCP (getPort set) (getHost set)) sClose- (\sock -> runServeTLSSocket tset set sock serve)+ (\sock -> runTLSSocket tset set sock app) ---------------------------------------------------------------- -- | Running 'Application' with 'TLSSettings' and 'Settings' using -- specified 'Socket'. runTLSSocket :: TLSSettings -> Settings -> Socket -> Application -> IO ()-runTLSSocket tset set sock = runServeTLSSocket tset set sock . serveDefault---- | Run an HTTP\/2-aware server with 'TLSSettings' and 'Settings' using--- specified 'Socket'.-runHTTP2TLSSocket :: TLSSettings -> Settings -> Socket -> HTTP2Application -> Application -> IO ()-runHTTP2TLSSocket tset set sock = runServeTLSSocket tset set sock .: serveHTTP2--runServeTLSSocket :: TLSSettings -> Settings -> Socket -> ServeConnection -> IO ()-runServeTLSSocket tlsset@TLSSettings{..} set sock serve = do+runTLSSocket tlsset@TLSSettings{..} set sock app = do credential <- case (certMemory, keyMemory) of (Nothing, Nothing) -> either error id <$>@@ -263,11 +241,11 @@ key <- maybe (S.readFile keyFile) return mkey either error return $ TLS.credentialLoadX509ChainFromMemory cert chainCertsMemory key- runServeTLSSocket' tlsset set credential sock serve+ runTLSSocket' tlsset set credential sock app -runServeTLSSocket' :: TLSSettings -> Settings -> TLS.Credential -> Socket -> ServeConnection -> IO ()-runServeTLSSocket' tlsset@TLSSettings{..} set credential sock serve =- runServeSettingsConnectionMakerSecure set get serve+runTLSSocket' :: TLSSettings -> Settings -> TLS.Credential -> Socket -> Application -> IO ()+runTLSSocket' tlsset@TLSSettings{..} set credential sock app =+ runSettingsConnectionMakerSecure set get app where get = getter tlsset sock params params = def { -- TLS.ServerParams
warp-tls.cabal view
@@ -1,5 +1,5 @@ Name: warp-tls-Version: 3.1.5+Version: 3.2.0 Synopsis: HTTP over TLS support for Warp via the TLS package License: MIT License-file: LICENSE@@ -19,8 +19,8 @@ Library Build-Depends: base >= 4 && < 5 , bytestring >= 0.9- , wai >= 3.0.4 && < 3.1- , warp >= 3.1.7 && < 3.2+ , wai >= 3.2 && < 3.3+ , warp >= 3.2 && < 3.3 , data-default-class >= 0.0.1 , tls >= 1.3.2 , network >= 2.2.1