module Network.TLS.PostHandshake
( requestCertificate
, requestCertificateServer
, postHandshakeAuthWith
, postHandshakeAuthClientWith
, postHandshakeAuthServerWith
) where
import Network.TLS.Context.Internal
import Network.TLS.IO
import Network.TLS.Struct13
import Network.TLS.Handshake.Common
import Network.TLS.Handshake.Client
import Network.TLS.Handshake.Server
import Control.Monad.State.Strict
requestCertificate :: MonadIO m => Context -> m Bool
requestCertificate :: forall (m :: * -> *). MonadIO m => Context -> m Bool
requestCertificate Context
ctx =
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. Context -> IO a -> IO a
withWriteLock Context
ctx forall a b. (a -> b) -> a -> b
$
Context -> IO ()
checkValid Context
ctx forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Context -> Context -> IO Bool
ctxDoRequestCertificate Context
ctx Context
ctx
postHandshakeAuthWith :: MonadIO m => Context -> Handshake13 -> m ()
postHandshakeAuthWith :: forall (m :: * -> *). MonadIO m => Context -> Handshake13 -> m ()
postHandshakeAuthWith Context
ctx Handshake13
hs =
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. Context -> IO a -> IO a
withWriteLock Context
ctx forall a b. (a -> b) -> a -> b
$ Context -> IO () -> IO ()
handleException Context
ctx forall a b. (a -> b) -> a -> b
$ Context -> Context -> Handshake13 -> IO ()
ctxDoPostHandshakeAuthWith Context
ctx Context
ctx Handshake13
hs