@ -107,12 +107,12 @@ tls con = fmap join -- We can have Left values both from exceptions and the
@@ -107,12 +107,12 @@ tls con = fmap join -- We can have Left values both from exceptions and the
modify ( \ s -> s { streamConnectionState = Secured } )
return ()
client :: ( MonadIO m , CPRG rng ) => Params -> rng -> Backend -> m Context
client :: ( MonadIO m , CPRG rng ) => Client Params -> rng -> Backend -> m Context
client params gen backend = do
contextNew backend params gen
tlsinit :: ( MonadIO m , MonadIO m1 ) =>
TLS Params
Client Params
-> Backend
-> m ( Source m1 BS . ByteString
, Sink BS . ByteString m1 ()
@ -164,7 +164,7 @@ mkReadBuffer recv = do
@@ -164,7 +164,7 @@ mkReadBuffer recv = do
-- seem to use it.
connectTls :: ResolvConf -- ^ Resolv conf to use (try 'defaultResolvConf' as a
-- default)
-> TLS Params -- ^ TLS parameters to use when securing the connection
-> Client Params -- ^ TLS parameters to use when securing the connection
-> String -- ^ Host to use when connecting (will be resolved
-- using SRV records)
-> ErrorT XmppFailure IO StreamHandle
@ -184,9 +184,7 @@ wrapExceptions :: IO a -> IO (Either XmppFailure a)
@@ -184,9 +184,7 @@ wrapExceptions :: IO a -> IO (Either XmppFailure a)
wrapExceptions f = Ex . catches ( liftM Right $ f )
[ Ex . Handler $ return . Left . XmppIOException
, Ex . Handler $ wrap . XmppTlsError
, Ex . Handler $ wrap . XmppTlsConnectionNotEstablished
, Ex . Handler $ wrap . XmppTlsTerminated
, Ex . Handler $ wrap . XmppTlsHandshakeFailed
, Ex . Handler $ wrap . XmppTlsException
, Ex . Handler $ return . Left
]
where