diff --git a/mighttpd2.cabal b/mighttpd2.cabal
--- a/mighttpd2.cabal
+++ b/mighttpd2.cabal
@@ -1,6 +1,6 @@
 cabal-version:      >=1.10
 name:               mighttpd2
-version:            4.0.3
+version:            4.0.4
 license:            BSD3
 license-file:       LICENSE
 maintainer:         Kazu Yamamoto <kazu@iij.ad.jp>
@@ -82,7 +82,7 @@
         unordered-containers,
         wai >=3.2 && <3.3,
         wai-app-file-cgi >=3.1.9 && <3.2,
-        warp >=3.3.15 && <3.4,
+        warp >=3.4 && <3.5,
         unliftio
 
     if impl(ghc >=8)
@@ -101,7 +101,7 @@
         Paths_mighttpd2
 
     default-language: Haskell2010
-    ghc-options:      -Wall -threaded -rtsopts
+    ghc-options:      -Wall -threaded -rtsopts "-with-rtsopts=-qn1 -A32m -kc2k"
     build-depends:
         base >=4.9 && <5,
         bytestring,
@@ -120,7 +120,7 @@
         wai >=3.2 && <3.3,
         wai-app-file-cgi >=3.1.9 && <3.2,
         wai-logger >=2.3.0,
-        warp >=3.3.13 && <3.4
+        warp >=3.4 && <3.5
 
     if flag(tls)
         cpp-options:   -DHTTP_OVER_TLS
diff --git a/src/Server.hs b/src/Server.hs
--- a/src/Server.hs
+++ b/src/Server.hs
@@ -84,13 +84,7 @@
     unless debug writePidFile
     rdr <- newRouteDBRef route
     tmgr <- T.initialize (naturalToInt (opt_connection_timeout opt) * 1000000)
-#ifdef HTTP_OVER_TLS
-    mcred <- Just <$> loadCredentials opt
-    smgr <- Just <$> SM.newSessionManager SM.defaultConfig { dbMaxSize = 1000 }
-#else
-    let mcred = Nothing
-        smgr = Nothing
-#endif
+    (mcred, smgr) <- setup opt
     _changed <- setGroupUser (opt_user opt) (opt_group opt)
 #ifdef DROP_EXCEPT_BIND
     when _changed dropExceptBind
@@ -229,7 +223,7 @@
             $ setServerPushLogger pushlgr
             defaultSettings
 #ifdef HTTP_OVER_TLS
-    tlsSetting = defaultTlsSettings {
+    ~tlsSetting = defaultTlsSettings {
         tlsCredentials    = _mcreds
       , tlsSessionManager = _msmgr
       , tlsAllowedVersions = [TLS.TLS13,TLS.TLS12]
@@ -251,10 +245,12 @@
         revProxyManager = mgr
       }
 #ifdef HTTP_OVER_QUIC
-    quicAddr = read <$> opt_quic_addr opt
-    quicPort = fromIntegral $ opt_quic_port opt
-    quicVersions = Q.scVersions Q.defaultServerConfig
-    qconf = Q.defaultServerConfig {
+    ~quicAddr = read <$> opt_quic_addr opt
+    ~quicPort = fromIntegral $ opt_quic_port opt
+    ~quicVersions = Q.scVersions Q.defaultServerConfig
+    -- Lazy binding for opt_service == 0 so that
+    -- 'fromJust' is not called.
+    ~qconf = Q.defaultServerConfig {
             Q.scAddresses      = (,quicPort) <$> quicAddr
           , Q.scALPN           = Just chooseALPN
           , Q.scRequireRetry   = False
@@ -288,6 +284,12 @@
              | HttpAndHttps Socket Socket
              | QUIC Socket Socket
 
+instance Show Service where
+    show HttpOnly{}     = "HttpOnly"
+    show HttpsOnly{}    = "HttpOnlys"
+    show HttpAndHttps{} = "HttpAndHttps"
+    show QUIC{}         = "QUIC"
+
 ----------------------------------------------------------------
 
 openService :: Option -> IO Service
@@ -360,4 +362,20 @@
     strtids <- listDirectory ("/proc/" ++ show pid ++ "/task")
     let tids = map read strtids :: [Int]
     forM_ tids $ \tid -> c_send_signal (fromIntegral tid) sigUSR1
+#endif
+
+----------------------------------------------------------------
+
+setup :: Option -> IO (Maybe Credentials, Maybe SessionManager)
+#ifdef HTTP_OVER_TLS
+setup opt
+  | 1 <= service && service <= 3 = do
+        mcred <- Just <$> loadCredentials opt
+        smgr <- Just <$> SM.newSessionManager SM.defaultConfig { dbMaxSize = 1000 }
+        return (mcred, smgr)
+  | otherwise = return (Nothing, Nothing)
+  where
+    service = opt_service opt
+#else
+setup _ = return (Nothing, Nothing)
 #endif
diff --git a/test/ConfigSpec.hs b/test/ConfigSpec.hs
--- a/test/ConfigSpec.hs
+++ b/test/ConfigSpec.hs
@@ -44,7 +44,7 @@
     , opt_tls_cert_file   = "cert.pem"
     , opt_tls_chain_files = "chain.pem"
     , opt_tls_key_file    = "privkey.pem"
-    , opt_quic_addr = ["127.0.0.1","::1"]
+    , opt_quic_addr = ["0.0.0.0","::"]
     , opt_quic_port = 443
     , opt_quic_debug_dir = Nothing
     , opt_quic_qlog_dir  = Nothing
