make runConnection take a certificate as a parameter
This commit is contained in:
parent
a15abeaa1f
commit
17f1eba583
|
@ -48,7 +48,7 @@ import qualified Data.ByteString as BS
|
|||
import Data.ByteString.Builder (charUtf8, stringUtf8, toLazyByteString)
|
||||
import qualified Data.ByteString.Lazy as BSL
|
||||
import Data.Char (chr, ord, toLower)
|
||||
import Data.IORef (IORef, newIORef, writeIORef)
|
||||
import Data.IORef (IORef, newIORef, readIORef, writeIORef)
|
||||
import Data.List (find, intercalate)
|
||||
import Data.Maybe (fromJust)
|
||||
import qualified Data.Text as T
|
||||
|
@ -183,7 +183,8 @@ listenLoop sock params handler = do
|
|||
let params' = adjustServerParams certRef params
|
||||
try (accept params' sock) >>= \case
|
||||
Left (_ :: IOException) -> return ()
|
||||
Right conn -> void $ forkIO $ runConnection conn handler
|
||||
Right conn -> void $ forkIO $
|
||||
readIORef certRef >>= runConnection conn handler
|
||||
listenLoop sock params handler
|
||||
|
||||
adjustServerParams
|
||||
|
|
|
@ -34,6 +34,7 @@ module Network.GemServ.Internal (
|
|||
runConnection
|
||||
) where
|
||||
|
||||
import Data.X509 (Certificate)
|
||||
import System.IO.Streams.TLS (TLSConnection)
|
||||
|
||||
import Network.GemServ.Types
|
||||
|
@ -45,6 +46,8 @@ runConnection
|
|||
-- ^ The connection
|
||||
-> GemHandler
|
||||
-- ^ The handler that produces the response
|
||||
-> Maybe Certificate
|
||||
-- ^ The client certificate (if available)
|
||||
-> IO ()
|
||||
runConnection = undefined
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user