diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
+## 3.1.1
+
+* Converting "send: resource vanished (Broken pipe)" to ConnectionClosedByPeer. [#421](https://github.com/yesodweb/wai/issues/421)
+
 ## 3.1.0
 
 * Supporting HTTP/2 [#399](https://github.com/yesodweb/wai/pull/399)
diff --git a/Network/Wai/Handler/WarpTLS.hs b/Network/Wai/Handler/WarpTLS.hs
--- a/Network/Wai/Handler/WarpTLS.hs
+++ b/Network/Wai/Handler/WarpTLS.hs
@@ -42,7 +42,8 @@
 #if __GLASGOW_HASKELL__ < 709
 import Control.Applicative ((<$>))
 #endif
-import Control.Exception (Exception, throwIO, bracket, finally, handle, fromException, try, IOException, onException)
+import Control.Exception (Exception, throwIO, bracket, finally, handle, fromException, try, IOException, onException, SomeException(..))
+import qualified Control.Exception as E
 import Control.Monad (void)
 import qualified Crypto.Random.AESCtr
 import qualified Data.ByteString as S
@@ -321,9 +322,11 @@
     backend recvN = TLS.Backend {
         TLS.backendFlush = return ()
       , TLS.backendClose = sClose s
-      , TLS.backendSend  = sendAll s
+      , TLS.backendSend  = sendAll' s
       , TLS.backendRecv  = recvN
       }
+    sendAll' sock bs = sendAll sock bs `E.catch` \(SomeException _) ->
+        throwIO ConnectionClosedByPeer
     conn ctx writeBuf ref = Connection {
         connSendMany         = TLS.sendData ctx . L.fromChunks
       , connSendAll          = sendall
diff --git a/warp-tls.cabal b/warp-tls.cabal
--- a/warp-tls.cabal
+++ b/warp-tls.cabal
@@ -1,5 +1,5 @@
 Name:                warp-tls
-Version:             3.1.0
+Version:             3.1.1
 Synopsis:            HTTP over TLS support for Warp via the TLS package
 License:             MIT
 License-file:        LICENSE
