[Haskell-cafe] Re: ANNOUNCE: tls, native TLS/SSL protocol implementation

Maciej Piechotka uzytkownik2 at gmail.com
Fri Oct 8 09:29:35 EDT 2010


On Fri, 2010-10-08 at 15:14 +0200, Michael Snoyman wrote:
> On Fri, Oct 8, 2010 at 1:59 PM, Maciej Piechotka <uzytkownik2 at gmail.com> wrote:
> > On Wed, 2010-10-06 at 22:26 +0100, Vincent Hanquez wrote:
> >> Hi haskellers,
> >>
> >> I'ld like to announce the tls package [1][2], which is a native implementation
> >> of the TLS protocol, client and server.  It's currently mostly supporting SSL3,
> >> TLS1.0 and TLS1.1.  It's got *lots* of rough edges, and a bunch of unsupported
> >> features, but it's humming along, and at each iteration it's becoming more
> >> tighly secure and featureful.
> >>
> >> I would recommend against using this implementation in a production system just
> >> yet, or in an aggressive environment either (specially for the server side);
> >> I don't think it should necessary fail, but it's still an early implementation
> >> with probable API changes on the way.
> >>
> >> [1] http://github.com/vincenthz/hs-tls
> >> [2] http://hackage.haskell.org/package/tls
> >
> > 1. Could also callback in addition to handles be added?
> > Like:
> >
> > connect' :: (ByteString -> IO ()) -> IO ByteString -> TLSClient IO ()
> >
> > Why:
> >  - It allows to wrap it into Enumerators
> 
> It's entirely possible to wrap the current interface into
> enumerators/iteratees[1]. That's how http-enumerator works.
> 
> Michael
> 
> [1] http://github.com/snoyberg/http-enumerator/blob/master/Network/TLS/Client/Enumerator.hs


I had in mind something like:

import Data.ByteString
import Data.Iteratee

clientEnum :: MonadIO m
           => params
           -> Enumerator ByteString m a
           -> Enumerator ByteString m a
clientEnum params client = ...

i.e.

clientEnum :: MonadIO m
           => params
           -> (Iteratee ByteString m a -> m (Iteratee ByteString m a))
              -- ^ Client function
           -> Iteratee ByteString m a --^ "Output"
           -> m (Iteratee ByteString m a) --^ "Input"

Where inner enumerator is simply a client side while 'outer' is a
outside/server part.

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20101008/3b0c92d1/attachment.bin


More information about the Haskell-Cafe mailing list