Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-warp-tls for openSUSE:Factory 
checked in at 2026-11-24 12:37:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-warp-tls (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-warp-tls.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-warp-tls"

Tue Nov 24 12:37:35 2026 rev:18 rq:1399410 version:3.4.19

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-warp-tls/ghc-warp-tls.changes        
2026-06-10 16:14:57.354928450 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-warp-tls.new.1340718/ghc-warp-tls.changes   
2026-11-24 12:44:16.435809849 +0100
@@ -1,0 +2,55 @@
+Thu Nov 19 09:05:21 UTC 2026 - Peter Simons <[email protected]>
+
+- Update warp-tls to version 3.4.19.
+  ## 3.4.19
+
+  * warp-tls: build with tls 2.6
+    [#1174](https://github.com/yesodweb/wai/pull/1174)
+
+  ## 3.4.18
+
+  * warp-tls: build with warp before 3.4.18 again
+    [#1167](https://github.com/yesodweb/wai/pull/1167)
+
+  ## 3.4.17
+
+  Requires network 3.2.12.
+
+  * The listening socket, and a connection socket no TLS context or
+    connection thread uses yet, are closed with `unsafeClose`.
+  * With warp 3.4.21's `setUnsafeClose`, a TLS connection is closed with
+    `unsafeGracefulClose`.
+  * Sends use network's `sendAllWith`, so warp's timeout reaches a send on
+    Windows too, and close_notify is given a quarter of the timeout, at
+    most a second.
+  * A send after the peer's close_notify is dropped.  The GOAWAY which ends
+    an HTTP/2 connection the client has closed used to reach
+    `settingsOnException` as `PostHandshake Error_EOF`.
+
+  ## 3.4.16
+
+  `tlsEarlyDataSize` defaults to 0, so 0-RTT is off unless a server asks for
+  it: a request in early data is replayable and warp-tls has no RFC 8470
+  handling.
+
+  * Let a server say how much TLS early data it accepts.
+    [#1145](https://github.com/yesodweb/wai/pull/1145)
+
+  ## 3.4.15
+
+  * The first read of a connection is given up on when the handshake
+    deadline passes, rather than interrupted by `timeout`, which does not
+    reach a socket call on Windows.
+
+  ## 3.4.14.1
+
+  * The accept loop is stopped the way warp's is, by being told rather than by
+    having its socket closed under it.  This needs `warp` 3.5.0 or later; built
+    against an earlier one, warp-tls is as it was.  It needs what warp needs,
+    too: not Windows, and `network` 3.2.2 or later.
+    [#1123](https://github.com/yesodweb/wai/pull/1123)
+
+  * Build with `warp-3.5.0`.
+    [#1095](https://github.com/yesodweb/wai/pull/1095)
+
+-------------------------------------------------------------------

Old:
----
  warp-tls-3.4.14.tar.gz

New:
----
  warp-tls-3.4.19.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-warp-tls.spec ++++++
--- /var/tmp/diff_new_pack.DmvmAG/_old  2026-11-24 12:44:18.443894955 +0100
+++ /var/tmp/diff_new_pack.DmvmAG/_new  2026-11-24 12:44:18.445895039 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-warp-tls
 #
-# Copyright (c) 2026 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,37 +17,49 @@
 
 
 %global pkg_name warp-tls
-%global pkgver %{pkg_name}-%{version}
-Name:           ghc-%{pkg_name}
-Version:        3.4.14
+%bcond_with ghc_prof
+%bcond_with tests
+Name:           ghc-%pkg_name
+Version:        3.4.19
 Release:        0
+%global pkgver %pkg_name-%{version}
 Summary:        HTTP over TLS support for Warp via the TLS package
 License:        MIT
-URL:            https://hackage.haskell.org/package/%{pkg_name}
-Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
+URL:            https://hackage.haskell.org/package/%pkg_name
+Source0:        
https://hackage.haskell.org/package/%pkg_name-%{version}/%pkg_name-%{version}.tar.gz
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-base-devel
-BuildRequires:  ghc-base-prof
 BuildRequires:  ghc-bytestring-devel
-BuildRequires:  ghc-bytestring-prof
 BuildRequires:  ghc-network-devel
-BuildRequires:  ghc-network-prof
 BuildRequires:  ghc-recv-devel
-BuildRequires:  ghc-recv-prof
-BuildRequires:  ghc-rpm-macros
+BuildRequires:  ghc-rpm-macros >= 2.9.2
 BuildRequires:  ghc-stm-devel
-BuildRequires:  ghc-stm-prof
 BuildRequires:  ghc-streaming-commons-devel
-BuildRequires:  ghc-streaming-commons-prof
 BuildRequires:  ghc-tls-devel
-BuildRequires:  ghc-tls-prof
 BuildRequires:  ghc-tls-session-manager-devel
-BuildRequires:  ghc-tls-session-manager-prof
 BuildRequires:  ghc-wai-devel
-BuildRequires:  ghc-wai-prof
 BuildRequires:  ghc-warp-devel
-BuildRequires:  ghc-warp-prof
 ExcludeArch:    %{ix86}
+%if %{with ghc_prof}
+BuildRequires:  ghc-base-prof
+BuildRequires:  ghc-bytestring-prof
+BuildRequires:  ghc-network-prof
+BuildRequires:  ghc-recv-prof
+BuildRequires:  ghc-stm-prof
+BuildRequires:  ghc-streaming-commons-prof
+BuildRequires:  ghc-tls-prof
+BuildRequires:  ghc-tls-session-manager-prof
+BuildRequires:  ghc-wai-prof
+BuildRequires:  ghc-warp-prof
+%endif
+%if %{with tests}
+BuildRequires:  ghc-async-devel
+BuildRequires:  ghc-hspec-devel
+%if %{with ghc_prof}
+BuildRequires:  ghc-async-prof
+BuildRequires:  ghc-hspec-prof
+%endif
+%endif
 
 %description
 SSLv1 and SSLv2 are obsoleted by IETF. We should use TLS 1.2 (or TLS 1.1 or TLS
@@ -64,24 +76,27 @@
 %description devel
 This package provides the Haskell %{pkg_name} library development files.
 
-%package -n ghc-%{pkg_name}-doc
+%package -n ghc-%pkg_name-doc
 Summary:        Haskell %{pkg_name} library documentation
 Requires:       ghc-filesystem
 BuildArch:      noarch
 
-%description -n ghc-%{pkg_name}-doc
+%description -n ghc-%pkg_name-doc
 This package provides the Haskell %{pkg_name} library documentation.
 
-%package -n ghc-%{pkg_name}-prof
+%if %{with ghc_prof}
+%package -n ghc-%pkg_name-prof
 Summary:        Haskell %{pkg_name} profiling library
-Requires:       ghc-%{pkg_name}-devel = %{version}-%{release}
-Supplements:    (ghc-%{pkg_name}-devel and ghc-prof)
+Requires:       ghc-%pkg_name-devel = %{version}-%{release}
+Supplements:    (ghc-%pkg_name-devel and ghc-prof)
 
-%description -n ghc-%{pkg_name}-prof
+%description -n ghc-%pkg_name-prof
 This package provides the Haskell %{pkg_name} profiling library.
+%endif
+
 
 %prep
-%autosetup -n %{pkg_name}-%{version}
+%autosetup -p1 -n %pkg_name-%{version}
 
 %build
 %ghc_lib_build
@@ -89,6 +104,9 @@
 %install
 %ghc_lib_install
 
+%check
+%cabal_test
+
 %post devel
 %ghc_pkg_recache
 
@@ -101,8 +119,10 @@
 %files devel -f %{name}-devel.files
 %doc ChangeLog.md README.md
 
-%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
+%files -n ghc-%pkg_name-doc -f ghc-%pkg_name-doc.files
 %license LICENSE
 
-%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
+%if %{with ghc_prof}
+%files -n ghc-%pkg_name-prof -f ghc-%pkg_name-prof.files
+%endif
 

++++++ warp-tls-3.4.14.tar.gz -> warp-tls-3.4.19.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-tls-3.4.14/ChangeLog.md 
new/warp-tls-3.4.19/ChangeLog.md
--- old/warp-tls-3.4.14/ChangeLog.md    2026-04-16 14:24:13.000000000 +0200
+++ new/warp-tls-3.4.19/ChangeLog.md    2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,56 @@
 # ChangeLog
 
+## 3.4.19
+
+* warp-tls: build with tls 2.6
+  [#1174](https://github.com/yesodweb/wai/pull/1174)
+
+## 3.4.18
+
+* warp-tls: build with warp before 3.4.18 again
+  [#1167](https://github.com/yesodweb/wai/pull/1167)
+
+## 3.4.17
+
+Requires network 3.2.12.
+
+* The listening socket, and a connection socket no TLS context or
+  connection thread uses yet, are closed with `unsafeClose`.
+* With warp 3.4.21's `setUnsafeClose`, a TLS connection is closed with
+  `unsafeGracefulClose`.
+* Sends use network's `sendAllWith`, so warp's timeout reaches a send on
+  Windows too, and close_notify is given a quarter of the timeout, at
+  most a second.
+* A send after the peer's close_notify is dropped.  The GOAWAY which ends
+  an HTTP/2 connection the client has closed used to reach
+  `settingsOnException` as `PostHandshake Error_EOF`.
+
+## 3.4.16
+
+`tlsEarlyDataSize` defaults to 0, so 0-RTT is off unless a server asks for
+it: a request in early data is replayable and warp-tls has no RFC 8470
+handling.
+
+* Let a server say how much TLS early data it accepts.
+  [#1145](https://github.com/yesodweb/wai/pull/1145)
+
+## 3.4.15
+
+* The first read of a connection is given up on when the handshake
+  deadline passes, rather than interrupted by `timeout`, which does not
+  reach a socket call on Windows.
+
+## 3.4.14.1
+
+* The accept loop is stopped the way warp's is, by being told rather than by
+  having its socket closed under it.  This needs `warp` 3.5.0 or later; built
+  against an earlier one, warp-tls is as it was.  It needs what warp needs,
+  too: not Windows, and `network` 3.2.2 or later.
+  [#1123](https://github.com/yesodweb/wai/pull/1123)
+
+* Build with `warp-3.5.0`.
+  [#1095](https://github.com/yesodweb/wai/pull/1095)
+
 ## 3.4.14
 
 * Build with `warp-3.4.13`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/warp-tls-3.4.14/Network/Wai/Handler/WarpTLS/Internal.hs 
new/warp-tls-3.4.19/Network/Wai/Handler/WarpTLS/Internal.hs
--- old/warp-tls-3.4.14/Network/Wai/Handler/WarpTLS/Internal.hs 2026-04-03 
17:52:12.000000000 +0200
+++ new/warp-tls-3.4.19/Network/Wai/Handler/WarpTLS/Internal.hs 2001-09-09 
03:46:40.000000000 +0200
@@ -124,6 +124,16 @@
     -- priority. See the "Network.TLS" module for details
     --
     --   Since 3.3.3
+    , tlsEarlyDataSize :: Int
+    -- ^ The largest TLS 1.3 early data this server accepts, 0 for none.
+    -- A request sent in early data can be replayed by anyone who
+    -- recorded it, and warp-tls does nothing about that: it has no RFC
+    -- 8470 handling and no 425 response. So 0-RTT is off unless this
+    -- says otherwise.
+    --
+    -- Default: 0
+    --
+    --   Since 3.4.16
     }
 
 -- Since 3.3.1
@@ -154,6 +164,7 @@
         , tlsCredentials = Nothing
         , tlsSessionManager = Nothing
         , tlsSupportedHashSignatures = TLS.supportedHashSignatures 
TLS.defaultSupported
+        , tlsEarlyDataSize = 0
         }
 
 -- taken from stunnel example in tls-extra
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-tls-3.4.14/Network/Wai/Handler/WarpTLS.hs 
new/warp-tls-3.4.19/Network/Wai/Handler/WarpTLS.hs
--- old/warp-tls-3.4.14/Network/Wai/Handler/WarpTLS.hs  2026-04-16 
14:24:13.000000000 +0200
+++ new/warp-tls-3.4.19/Network/Wai/Handler/WarpTLS.hs  2001-09-09 
03:46:40.000000000 +0200
@@ -1,5 +1,4 @@
 {-# LANGUAGE CPP #-}
-{-# LANGUAGE DeriveDataTypeable #-}
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE PatternGuards #-}
 {-# LANGUAGE RankNTypes #-}
@@ -48,6 +47,7 @@
     tlsServerDHEParams,
     tlsSessionManagerConfig,
     tlsSessionManager,
+    tlsEarlyDataSize,
     onInsecure,
     OnInsecure (..),
 
@@ -59,9 +59,7 @@
 ) where
 
 import Control.Applicative ((<|>))
-#if MIN_VERSION_warp(3,4,13)
-import Control.Concurrent.STM (newTVarIO, TVar)
-#endif
+import Control.Concurrent.STM
 import Control.Exception (
     Exception,
     IOException,
@@ -80,21 +78,26 @@
 import qualified Data.ByteString as S
 import qualified Data.ByteString.Lazy as L
 import qualified Data.IORef as I
-import Data.Streaming.Network (bindPortTCP, safeRecv)
-import Data.Typeable (Typeable)
+import Data.Streaming.Network (bindPortTCP)
 import GHC.IO.Exception (IOErrorType (..))
 import Network.Socket (
     SockAddr,
     Socket,
-    close,
     getSocketName,
+#if !MIN_VERSION_network(3,1,1) || !MIN_VERSION_warp(3,4,18)
+    close,
+#endif
 #if MIN_VERSION_network(3,1,1)
     gracefulClose,
 #endif
+    unsafeClose,
     withSocketsDo,
  )
+#if MIN_VERSION_warp(3,4,21)
+import Network.Socket (unsafeGracefulClose)
+#endif
 import Network.Socket.BufferPool
-import Network.Socket.ByteString (sendAll)
+import Network.Socket.ByteString (recvWith, sendAll, sendAllWith)
 import qualified Network.TLS as TLS
 import qualified Network.TLS.SessionManager as SM
 import Network.Wai (Application)
@@ -227,7 +230,7 @@
     withSocketsDo $
         bracket
             (bindPortTCP (getPort set) (getHost set))
-            close
+            unsafeClose
             ( \sock -> do
                 setSocketCloseOnExec sock
                 runTLSSocket tset set sock app
@@ -264,25 +267,45 @@
 --   specified 'Socket'.
 runTLSSocket :: TLSSettings -> Settings -> Socket -> Application -> IO ()
 runTLSSocket tlsset set sock app = do
+#if MIN_VERSION_warp(3,4,18)
+    -- The accept loop is stopped by being told, not by having this socket
+    -- closed under it; the socket is closed once the loop has ended.  See
+    -- 'Network.Wai.Handler.Warp.Internal.Listener'.
+    listener <- makeListener set sock
+#else
     settingsInstallShutdownHandler set (close sock)
+#endif
     credentials <- loadCredentials tlsset
     mgr <- getSessionManager tlsset
+#if MIN_VERSION_warp(3,4,18)
+    runTLSSocket' tlsset set listener credentials mgr sock app
+#else
     runTLSSocket' tlsset set credentials mgr sock app
+#endif
 
 runTLSSocket'
     :: TLSSettings
     -> Settings
+#if MIN_VERSION_warp(3,4,18)
+    -> Listener
+#endif
     -> TLS.Credentials
     -> TLS.SessionManager
     -> Socket
     -> Application
     -> IO ()
+#if MIN_VERSION_warp(3,4,18)
+runTLSSocket' tlsset@TLSSettings{..} set listener credentials mgr sock app = do
+    (_, newSettings) <- makeServerState set
+    let get = getter tlsset newSettings listener sock params
+    runSettingsConnectionMakerSecureWith newSettings listener get app
+#elif MIN_VERSION_warp(3,4,13)
 runTLSSocket' tlsset@TLSSettings{..} set credentials mgr sock app = do
-#if MIN_VERSION_warp(3,4,13)
     (_, newSettings) <- makeServerState set
     let get = getter tlsset newSettings sock params
     runSettingsConnectionMakerSecure newSettings get app
 #else
+runTLSSocket' tlsset@TLSSettings{..} set credentials mgr sock app = do
     let get = getter tlsset set sock params
     runSettingsConnectionMakerSecure set get app
 #endif
@@ -296,7 +319,7 @@
             , TLS.serverShared = shared
             , TLS.serverSupported = supported
 #if MIN_VERSION_tls(1,5,0)
-            , TLS.serverEarlyDataSize = 2018
+            , TLS.serverEarlyDataSize = fromIntegral tlsEarlyDataSize
 #endif
             }
     -- Adding alpn to user's tlsServerHooks.
@@ -337,13 +360,24 @@
     :: TLS.TLSParams params
     => TLSSettings
     -> Settings
+#if MIN_VERSION_warp(3,4,18)
+    -> Listener
+#endif
     -> Socket
     -> params
     -> IO (IO (Connection, Transport), SockAddr)
+#if MIN_VERSION_warp(3,4,18)
+getter tlsset set listener _sock params = do
+    macc <- acceptOrStop listener
+    (s, sa) <- maybe (throwIO AcceptStopped) return macc
+    setSocketCloseOnExec s
+    return (mkConn tlsset set s params, sa)
+#else
 getter tlsset set@Settings{settingsAccept = accept'} sock params = do
     (s, sa) <- accept' sock
     setSocketCloseOnExec s
     return (mkConn tlsset set s params, sa)
+#endif
 
 mkConn
     :: TLS.TLSParams params
@@ -354,14 +388,25 @@
     -> IO (Connection, Transport)
 mkConn tlsset set s params = do
     let tm = settingsTimeout set * 1000000
-    mbs <- timeout tm recvFirstBS
-    case mbs of
-      Nothing -> throwIO IncompleteHeaders
-      Just bs -> switch bs
+    -- The first read is given up on when the deadline passes, rather than
+    -- interrupted by 'timeout': an asynchronous exception does not reach a
+    -- thread blocked in a socket call on Windows.
+    expired <- registerDelay tm
+    ebs <- recvFirstBS expired
+    case ebs of
+      Left () -> throwIO IncompleteHeaders
+      Right bs -> switch bs
   where
-    recvFirstBS = safeRecv s 4096 `onException` close s
+    recvFirstBS expired =
+        (recvWith s 4096 (check =<< readTVar expired) `E.catch` resetIsEOF)
+            `onException` unsafeClose s
+    -- What streaming-commons' safeRecv did for us: a connection reset is
+    -- the end of the connection, not an error to report.
+    resetIsEOF e
+        | ioeGetErrorType e == ResourceVanished = return $ Right ""
+        | otherwise = E.throwIO (e :: E.IOException)
     switch firstBS
-        | S.null firstBS = close s >> throwIO ClientClosedConnectionPrematurely
+        | S.null firstBS = unsafeClose s >> throwIO 
ClientClosedConnectionPrematurely
         | S.head firstBS == 0x16 = httpOverTls tlsset set s firstBS params
         | otherwise = plainHTTP tlsset set s firstBS
 
@@ -387,7 +432,7 @@
     -> params
     -> IO (Connection, Transport)
 httpOverTls TLSSettings{..} set s bs0 params =
-    makeConn `onException` close s
+    makeConn `onException` unsafeClose s
   where
     makeConn = do
         pool <- newBufferPool 2048 16384
@@ -407,26 +452,39 @@
             TLS.handshake ctx
             mysa <- getSocketName s
 #if MIN_VERSION_warp(3,4,13)
-            attachConn mysa ctx appsInProgress
+            attachConnWith byeTimeout mysa ctx appsInProgress
 #else
-            attachConn mysa ctx
+            attachConnWith byeTimeout mysa ctx
 #endif
         case mconn of
           Nothing -> throwIO IncompleteHeaders
           Just conn -> return conn
     wrappedRecvN recvN n = handle (throughAsync (return "")) $ recvN n
+    -- A peer which does not read is why a timed-out connection is
+    -- closed, so close_notify is given a quarter of the timeout, at most
+    -- a second, rather than waiting for that peer for ever.
+    byeTimeout
+        | settingsTimeout set <= 0 = 1000000
+        | otherwise = max 1 $ min 1000000 $ settingsTimeout set * 250000
+    gracefulCloser
+#if MIN_VERSION_warp(3,4,21)
+        | settingsUnsafeClose set = unsafeGracefulClose
+#endif
+        | otherwise = gracefulClose
     backend recvN =
         TLS.Backend
             { TLS.backendFlush = return ()
 #if MIN_VERSION_network(3,1,1)
             , TLS.backendClose =
-                gracefulClose s 5000 `E.catch` throughAsync (return ())
+                gracefulCloser s 5000 `E.catch` throughAsync (return ())
 #else
             , TLS.backendClose = close s
 #endif
             , TLS.backendSend = sendAll' s
             , TLS.backendRecv = recvN
             }
+    -- A plain send is a foreign call no asynchronous exception
+    -- reaches on Windows; this one waits in STM, so the timeout can.
     sendAll' sock bs =
         E.handleJust
             ( \e ->
@@ -435,7 +493,7 @@
                     else Nothing
             )
             throwIO
-            $ sendAll sock bs
+            $ void (sendAllWith sock bs (retry :: STM ()))
 
 -- | Get "Connection" and "Transport" for a TLS connection that is already did 
the handshake.
 -- @since 3.4.7
@@ -444,10 +502,22 @@
     -> TLS.Context
 #if MIN_VERSION_warp(3,4,13)
     -> TVar Int -> IO (Connection, Transport)
-attachConn mysa ctx appsInProgress = do
 #else
     -> IO (Connection, Transport)
-attachConn mysa ctx = do
+#endif
+attachConn = attachConnWith 1000000
+
+-- | 'attachConn' giving close_notify the microseconds given.
+attachConnWith
+    :: Int
+    -> SockAddr
+    -> TLS.Context
+#if MIN_VERSION_warp(3,4,13)
+    -> TVar Int -> IO (Connection, Transport)
+attachConnWith byeTimeout mysa ctx appsInProgress = do
+#else
+    -> IO (Connection, Transport)
+attachConnWith byeTimeout mysa ctx = do
 #endif
     h2 <- (== Just "h2") <$> TLS.getNegotiatedProtocol ctx
     isH2 <- I.newIORef h2
@@ -459,7 +529,7 @@
   where
     conn writeBufferRef isH2 =
         Connection
-            { connSendMany = TLS.sendData ctx . L.fromChunks
+            { connSendMany = afterCloseNotify . TLS.sendData ctx . L.fromChunks
             , connSendAll = sendall
             , connSendFile = sendfile
             , connClose = close'
@@ -473,7 +543,13 @@
 #endif
             }
       where
-        sendall = TLS.sendData ctx . L.fromChunks . return
+        sendall = afterCloseNotify . TLS.sendData ctx . L.fromChunks . return
+        -- tls answers the peer's close_notify with its own, so a send after
+        -- it has nowhere to go: dropped, as the GOAWAY which ends an HTTP/2
+        -- connection the peer has closed.
+        afterCloseNotify = handle $ \e -> case E.fromException e of
+            Just (TLS.PostHandshake TLS.Error_EOF) -> return ()
+            _ -> throwIO (e :: SomeException)
         recv = handle onEOF $ TLS.recvData ctx
           where
             onEOF e
@@ -487,8 +563,14 @@
         sendfile fid offset len hook headers = do
             writeBuffer <- I.readIORef writeBufferRef
             readSendFile
+-- readSendFile takes the WriteBuffer itself from 3.5.0, not from 3.4.18:
+-- the Listener work went out as 3.4.18 and this did not.
+#if MIN_VERSION_warp(3,5,0)
+                writeBuffer
+#else
                 (bufBuffer writeBuffer)
                 (bufSize writeBuffer)
+#endif
                 sendall
                 fid
                 offset
@@ -497,7 +579,7 @@
                 headers
 
         close' =
-            void (tryIO sendBye)
+            void (tryIO $ timeout byeTimeout sendBye)
                 `finally` TLS.contextClose ctx
 
         sendBye =
@@ -566,7 +648,7 @@
             \\r\nConnection: Upgrade\
             \\r\nContent-Type: text/plain\r\n\r\n"
         mapM_ (sendAll s) $ L.toChunks lbs
-        close s
+        unsafeClose s
         throwIO InsecureConnectionDenied
 
 ----------------------------------------------------------------
@@ -588,5 +670,5 @@
 data WarpTLSException
     = InsecureConnectionDenied
     | ClientClosedConnectionPrematurely
-    deriving (Show, Typeable)
+    deriving (Show)
 instance Exception WarpTLSException
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-tls-3.4.14/certificate.pem 
new/warp-tls-3.4.19/certificate.pem
--- old/warp-tls-3.4.14/certificate.pem 1970-01-01 01:00:00.000000000 +0100
+++ new/warp-tls-3.4.19/certificate.pem 2001-09-09 03:46:40.000000000 +0200
@@ -0,0 +1,15 @@
+-----BEGIN CERTIFICATE-----
+MIICWDCCAcGgAwIBAgIJAJG1ZMlcMDW6MA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQwHhcNMTExMDIyMTk0MjU3WhcNMTExMTIxMTk0MjU3WjBF
+MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
+ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
+gQCfYZx7kV6ybogMyAf9MINm7Rwin5LKh+TpD1ZkbLgmqFVotQCdthgTK66SPXkx
+EXGI27biNzacJhX7Ml7/4o8sp2GslYKUO46DYvgi/nnNX/bzA5cDJSSGK11eQEVs
++p0GEZ/6Juhpx/oQwMDMgo0UHkiH8QtKI8ojXnFF2MsLNwIDAQABo1AwTjAdBgNV
+HQ4EFgQUaA6FbOj/0VJMb4egNyIDZ/ZNV/YwHwYDVR0jBBgwFoAUaA6FbOj/0VJM
+b4egNyIDZ/ZNV/YwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCTQyOk
+D86Z+yzedXjTLI6FT8QugmQne1YQ8P0w37P76z2reagSvNee2e9B1oTHoPeKZMs0
+k99oS9yJ/NOQ1Ms90P+q0yBVGxAs/gF65qKgE27YGXzNtNobj/D4OoxcFG+BsORw
+VvYSBV4FiVy9RwJsr7AMqkUBcOEPCuJHgTx58w==
+-----END CERTIFICATE-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-tls-3.4.14/key.pem new/warp-tls-3.4.19/key.pem
--- old/warp-tls-3.4.14/key.pem 1970-01-01 01:00:00.000000000 +0100
+++ new/warp-tls-3.4.19/key.pem 2001-09-09 03:46:40.000000000 +0200
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQCfYZx7kV6ybogMyAf9MINm7Rwin5LKh+TpD1ZkbLgmqFVotQCd
+thgTK66SPXkxEXGI27biNzacJhX7Ml7/4o8sp2GslYKUO46DYvgi/nnNX/bzA5cD
+JSSGK11eQEVs+p0GEZ/6Juhpx/oQwMDMgo0UHkiH8QtKI8ojXnFF2MsLNwIDAQAB
+AoGAR8pgAgjo7tZ60ccIUjOX/LSxB6d5J2Eu6wvNjk6qZD9OuWtOa7up/HigmZ63
+CDMjQNI2/o6AOrWtEQkPYZNbibuifzg5V517nHGSqkqjoIgesAiwEsoKpeOgGTtM
+MM08oHbJ9uOnDnEEnDBiE0iE3jCTDfmwjqDMpUhu9dZ1EAECQQDKVpzSSV3pzMOp
+ixNxMpYxzcE+4K9jgM+MlxPBJSQhVrg/cRQWb26cKBi8LdSxF23hQTsFr+8qLwid
+Ah2AgUOBAkEAyaaCjrNRCiHRpd6YzWZ6GKkxbUvxSuOKX3N7hDaE2OFzQTv2Li8B
+5mrCsXnSZtOG+MBFdHU66UYie1OzDSDKtwJAKMsvkOID0ihbZmpIwDC/wUjHZkLs
+eXY14hVvgShY0XPnb7r/nspWlZsr6Xyf/hhIKfr5yFrBMFMNPIJ5qjflgQJAWsyV
+YTgxN4S+6BdxapvIQq58ySA3CGeo+Q4BAimibB4oTal4UpdsHZrZDB00toRs9Dlv
+jN70pfGkuS+ZIkIvxQJBAKSf5qpXWp4oZcThkieAiMeAhG96xqRPXhPUxq6QF+YG
+T4PF1sjlpZwqy7C+2oF3BqLP09mCW7YkH9Jgnl1zDF8=
+-----END RSA PRIVATE KEY-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-tls-3.4.14/test/Spec.hs 
new/warp-tls-3.4.19/test/Spec.hs
--- old/warp-tls-3.4.14/test/Spec.hs    1970-01-01 01:00:00.000000000 +0100
+++ new/warp-tls-3.4.19/test/Spec.hs    2001-09-09 03:46:40.000000000 +0200
@@ -0,0 +1,90 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Main (main) where
+
+import Control.Concurrent (newChan, readChan, writeChan, newEmptyMVar, 
putMVar, takeMVar)
+import Control.Concurrent.Async (link, mapConcurrently, withAsync)
+import Control.Exception (SomeException, bracket, fromException, throwIO)
+import Control.Monad (forM_, replicateM, when)
+import Data.Word (Word8)
+import qualified Network.Socket as S
+import qualified Network.Socket.ByteString as B
+import qualified Network.Wai.Handler.Warp as Warp
+import qualified Network.Wai.Handler.WarpTLS as TLS
+import System.Info (os)
+import System.Timeout (timeout)
+import Test.Hspec
+
+main :: IO ()
+main = hspec $ do
+    describe "early data" $
+        -- A request in early data is replayable and warp-tls has no RFC
+        -- 8470 handling, so 0-RTT is off until a server asks for it.
+        it "is not accepted unless asked for" $
+            TLS.tlsEarlyDataSize TLS.defaultTlsSettings `shouldBe` 0
+
+    describe "pre-TLS exception peer (#1113)" $ do
+        it "attributes sequential plaintext and premature-close failures to 
their sockets" $
+            exercise [1, 1] False
+        it "attributes concurrent plaintext and premature-close failures to 
their sockets" $
+            exercise [1, 1] True
+
+        -- Linux provides the whole 127/8 loopback range without interface 
aliases.
+        -- Keep the original two-IP regression there; other platforms still 
check
+        -- exact socket addresses (including source ports) above. The maker 
tests
+        -- additionally check distinct IPs without binding sockets on every 
platform.
+        when (os == "linux") $ do
+            it "attributes sequential failures from distinct loopback IPs" $
+                exercise [1, 2] False
+            it "attributes concurrent failures from distinct loopback IPs" $
+                exercise [1, 2] True
+
+-- These regressions deliberately leave Warp's accept and fork hooks alone.
+-- Keep both peers and failure kinds when changing the exception observer.
+exercise :: [Word8] -> Bool -> IO ()
+exercise hosts concurrent = S.withSocketsDo $
+    bracket (S.socket S.AF_INET S.Stream S.defaultProtocol) S.close $ 
\listener -> do
+        S.bind listener (S.SockAddrInet 0 (S.tupleToHostAddress (127, 0, 0, 
1)))
+        S.listen listener 10
+        port <- S.socketPort listener
+        events <- newChan
+        ready <- newEmptyMVar
+        let report address exception = case fromException exception of
+                Just tlsException -> writeChan events (address, show 
(tlsException :: TLS.WarpTLSException))
+                Nothing -> throwIO exception
+            settings = Warp.setBeforeMainLoop (putMVar ready ()) $ observePeer 
report Warp.defaultSettings
+            application _ _ = fail "connection must fail before the 
application"
+            tls = TLS.tlsSettings "certificate.pem" "key.pem"
+            clients = [(host, plaintext) | host <- hosts, plaintext <- [True, 
False]]
+            send (host, plaintext) = bracket (S.socket S.AF_INET S.Stream 
S.defaultProtocol) S.close $ \client -> do
+                S.bind client (S.SockAddrInet 0 (S.tupleToHostAddress (127, 0, 
0, host)))
+                S.connect client (S.SockAddrInet port (S.tupleToHostAddress 
(127, 0, 0, 1)))
+                own <- S.getSocketName client
+                if plaintext
+                    then do
+                        B.sendAll client "GET / HTTP/1.1\r\nHost: 
localhost\r\nConnection: close\r\n\r\n"
+                        -- Let WarpTLS send its denial before closing the 
client;
+                        -- an early close could cause a different send 
exception.
+                        timeout 2000000 (drain client) `shouldReturn` Just ()
+                    else S.shutdown client S.ShutdownSend
+                pure (Just own, if plaintext then "InsecureConnectionDenied" 
else "ClientClosedConnectionPrematurely")
+        withAsync (TLS.runTLSSocket tls settings listener application) $ 
\server -> do
+            link server
+            timeout 2000000 (takeMVar ready) `shouldReturn` Just ()
+            if concurrent
+                then do
+                    expected <- mapConcurrently send clients
+                    actual <- timeout 2000000 (replicateM (length clients) 
(readChan events))
+                    fmap length actual `shouldBe` Just (length clients)
+                    maybe (expectationFailure "missing TLS observations") 
(`shouldMatchList` expected) actual
+                else forM_ clients $ \client -> do
+                    expected <- send client
+                    timeout 2000000 (readChan events) `shouldReturn` Just 
expected
+
+observePeer :: (Maybe S.SockAddr -> SomeException -> IO ()) -> Warp.Settings 
-> Warp.Settings
+observePeer report = Warp.setOnConnectionException (report . Just)
+
+drain :: S.Socket -> IO ()
+drain client = do
+    bytes <- B.recv client 4096
+    if bytes == "" then pure () else drain client
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-tls-3.4.14/warp-tls.cabal 
new/warp-tls-3.4.19/warp-tls.cabal
--- old/warp-tls-3.4.14/warp-tls.cabal  2026-04-16 14:24:13.000000000 +0200
+++ new/warp-tls-3.4.19/warp-tls.cabal  2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
 Name:                warp-tls
-Version:             3.4.14
+Version:             3.4.19
 Synopsis:            HTTP over TLS support for Warp via the TLS package
 License:             MIT
 License-file:        LICENSE
@@ -15,15 +15,15 @@
                      HTTP/2 can be negotiated by ALPN.
                      API docs and the README are available at
                      <http://www.stackage.org/package/warp-tls>.
-extra-source-files:  ChangeLog.md README.md
+extra-source-files:  ChangeLog.md README.md certificate.pem key.pem
 
 Library
   Build-Depends:     base                          >= 4.12     && < 5
                    , bytestring                    >= 0.9
                    , wai                           >= 3.2      && < 3.3
-                   , warp                          >= 3.3.29   && < 3.5
-                   , tls                           >= 2.1.3    && < 2.5
-                   , network                       >= 2.2.1
+                   , warp                          >= 3.3.29   && < 3.6
+                   , tls                           >= 2.1.3    && < 2.7
+                   , network                       >= 3.2.12
                    , streaming-commons
                    , stm                           >= 2.3
                    , tls-session-manager           >= 0.0.4
@@ -42,3 +42,18 @@
   type:     git
   location: https://github.com/yesodweb/wai.git
   subdir:   warp-tls
+
+Test-Suite spec
+  Type: exitcode-stdio-1.0
+  Main-Is: Spec.hs
+  Hs-Source-Dirs: test
+  Default-Language: Haskell2010
+  Ghc-Options: -Wall -threaded
+  Build-Depends: base >= 4.12 && < 5
+               , async
+               , bytestring
+               , hspec >= 2
+               , network >= 3.2.10
+               , wai
+               , warp >= 3.4.18 && < 3.6
+               , warp-tls

Reply via email to