summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuYamamoto <>2017-11-14 08:32:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-11-14 08:32:00 (GMT)
commit8254ead60ea256f4f383089a6664d76ce49a904c (patch)
tree7b8bfc3ed7cede9691665cd25c0e2031c810f549
parent4f937098aed761a98f3d3743af58b4858ab531e4 (diff)
version 3.4.2HEAD3.4.2master
-rw-r--r--mighttpd2.cabal6
-rw-r--r--src/Server.hs9
2 files changed, 11 insertions, 4 deletions
diff --git a/mighttpd2.cabal b/mighttpd2.cabal
index 38cd786..5fe314a 100644
--- a/mighttpd2.cabal
+++ b/mighttpd2.cabal
@@ -1,5 +1,5 @@
Name: mighttpd2
-Version: 3.4.1
+Version: 3.4.2
Author: Kazu Yamamoto <kazu@iij.ad.jp>
Maintainer: Kazu Yamamoto <kazu@iij.ad.jp>
License: BSD3
@@ -67,6 +67,7 @@ Executable mighty
if flag(tls)
Cpp-Options: -DHTTP_OVER_TLS
Build-Depends: async
+ , tls-session-manager
Build-Depends: base >= 4.0 && < 5
, bytestring
, directory
@@ -88,8 +89,7 @@ Executable mighty
if flag(tls)
Build-Depends: tls
, warp-tls >= 3.2 && < 3.3
- Other-Modules: Mighty
- Server
+ Other-Modules: Server
WaiApp
Paths_mighttpd2
diff --git a/src/Server.hs b/src/Server.hs
index 6ef798a..3355ee5 100644
--- a/src/Server.hs
+++ b/src/Server.hs
@@ -6,8 +6,10 @@ import Control.Concurrent (runInUnboundThread)
import Control.Exception (try)
import Control.Monad (unless, when)
import qualified Data.ByteString.Char8 as BS
+#ifdef HTTP_OVER_TLS
import Data.Char (isSpace)
import Data.List (dropWhile, dropWhileEnd, break)
+#endif
import Data.Streaming.Network (bindPortTCP)
import Network (Socket, sClose)
import qualified Network.HTTP.Client as H
@@ -29,6 +31,7 @@ import qualified Network.Wai.Middleware.Push.Referer as P
import Control.Concurrent.Async (concurrently)
import Control.Monad (void)
import Network.Wai.Handler.WarpTLS
+import Network.TLS.SessionManager
#else
data TLSSettings = TLSSettings
#endif
@@ -137,7 +140,11 @@ getTlsSetting _opt =
chain_files = map strip $ split $ opt_tls_chain_files _opt
chains <- mapM BS.readFile chain_files
key <- BS.readFile $ opt_tls_key_file _opt
- return $ tlsSettingsChainMemory cert chains key
+ let settings0 = tlsSettingsChainMemory cert chains key
+ settings = settings0 {
+ tlsSessionManagerConfig = Just defaultConfig
+ }
+ return settings
#else
return TLSSettings
#endif