Safe Haskell | None |
---|---|
Language | Haskell2010 |
- tlsServeWithALPN :: FilePath -> FilePath -> String -> [(String, Attendant)] -> Int -> IO ()
- tlsServeWithALPNAndFinishOnRequest :: FilePath -> FilePath -> String -> [(String, Attendant)] -> Int -> MVar FinishRequest -> IO ()
- enableConsoleLogging :: IO ()
- logit :: ByteString -> IO ()
- data TLSLayerGenericProblem = TLSLayerGenericProblem String
- data FinishRequest = FinishRequest
High level OpenSSL functions.
Use these functions to create your TLS-compliant HTTP/2 server in a snap.
:: FilePath | Path to a certificate the server is going to use to identify itself. Bear in mind that multiple domains can be served from the same HTTP/2 TLS socket, so please create the HTTP/2 certificate accordingly. Also, currently this function only accepts paths to certificates or certificate chains in .pem format. |
-> FilePath | Path to the key of your certificate. |
-> String | Name of the network interface where you want to start your server |
-> [(String, Attendant)] | List of protocol names and the corresponding |
-> Int | Port to open to listen for connections. |
-> IO () |
Simple function to open
tlsServeWithALPNAndFinishOnRequest Source
:: FilePath | |
-> FilePath | Same as for |
-> String | Same as for |
-> [(String, Attendant)] | Same as for |
-> Int | Same as for |
-> MVar FinishRequest | Finish request, write a value here to finish serving |
-> IO () |
Interruptible version of tlsServeWithALPN
. Use the extra argument to ask
the server to finish: you pass an empty MVar and when you want to finish you
just populate it.
enableConsoleLogging :: IO () Source
Activates logging to terminal
data TLSLayerGenericProblem Source
Exceptions inheriting from IOProblem
. This is thrown by the
OpenSSL subsystem to signal that the connection was broken or that
otherwise there was a problem at the SSL layer.
TLSLayerGenericProblem String |
Show TLSLayerGenericProblem Source | |
Exception TLSLayerGenericProblem Source |
data FinishRequest Source
Singleton type. Used in conjunction with an MVar
. If the MVar is full,
the fuction tlsServeWithALPNAndFinishOnRequest
knows that it should finish
at its earliest convenience and call the CloseAction
for any open sessions.