module Network.TLS.PostHandshake (
requestCertificate,
requestCertificateServer,
requestCertificateAsync,
requestCertificateAsyncServer,
postHandshakeAuthWith,
postHandshakeAuthClientWith,
) where
import Network.TLS.Context.Internal
import Network.TLS.Handshake.Client
import Network.TLS.Handshake.Common
import Network.TLS.Handshake.Server
import Network.TLS.IO
import Network.TLS.Struct13
{-# DEPRECATED
requestCertificate
"Application data before the response closes the connection; use requestCertificateAsync"
#-}
requestCertificate :: Context -> IO Bool
requestCertificate :: Context -> IO Bool
requestCertificate Context
ctx =
Context -> IO ()
checkValid Context
ctx IO () -> IO Bool -> IO Bool
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> RoleParams -> Context -> IO Bool
doRequestCertificate_ (Context -> RoleParams
ctxRoleParams Context
ctx) Context
ctx
requestCertificateAsync :: Context -> IO (Bool -> IO PHAResult)
requestCertificateAsync :: Context -> IO (Bool -> IO PHAResult)
requestCertificateAsync Context
ctx =
Context -> IO ()
checkValid Context
ctx IO () -> IO (Bool -> IO PHAResult) -> IO (Bool -> IO PHAResult)
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> RoleParams -> Context -> IO (Bool -> IO PHAResult)
doRequestCertificateAsync_ (Context -> RoleParams
ctxRoleParams Context
ctx) Context
ctx
postHandshakeAuthWith :: Context -> Handshake13R -> IO ()
postHandshakeAuthWith :: Context -> Handshake13R -> IO ()
postHandshakeAuthWith Context
ctx Handshake13R
hb =
Context -> IO () -> IO ()
forall a. Context -> IO a -> IO a
withWriteLock Context
ctx (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
Context -> IO () -> IO ()
handleException Context
ctx (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
RoleParams -> Context -> Handshake13R -> IO ()
doPostHandshakeAuthWith_ (Context -> RoleParams
ctxRoleParams Context
ctx) Context
ctx Handshake13R
hb