Helpers for common Async functions#150
Conversation
|
I'm not keen on these changes, it adds quite some duplication and complexity to X.509. Instead, my intuition is that
|
|
['a Or_error.t] is type-equal to [('a, Error.t) result]. Error comes from Base so it can't easily be expressed as a Stdlib type, unfortunately. Roughly it's a lazily evaluated string and is semantically the same as [('a, [`Msg of string]) result], with the added benefit of excellent ppx support and other niceties one gets from using Base / Core / Async. Any code written with Async will want to convert [('a, [`Msg of string]) result] to ['a Or_error.t]. Dropping Cstruct sounds like a usability win to me! I'm not picky on how that happens; I've just found myself writing I do want to call out that the interface changes to the Authenticator module are going to be needed by any Async code running on Unix that wants to do chain-of-trust authentication (and therefore wants to read in a file with trust anchors). That and the |
|
@torinnd as an intermediate solution -- similar to x509_lwt is present in tls.lwt -- we could have that I/O dependent functionality in tls-async. this is not the cleanest thing to do, but since 99% of users of x509 use it via tls, I'd be fine with that. |
|
That works for me! I've rewritten this PR with this feedback in mind and will offer it to the ocaml-tls repository today or tomorrow. |
I propose introducing x509-async with the following general changes:
This could be used as a replacement for the [X509_async] module in tls-async's example test_server. It should also simplify any future projects that use tls-async.