Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put X509.Authenticator.authenticate into an IO monad? #31

Open
dsheets opened this issue Jan 15, 2015 · 6 comments
Open

Put X509.Authenticator.authenticate into an IO monad? #31

dsheets opened this issue Jan 15, 2015 · 6 comments

Comments

@dsheets
Copy link

dsheets commented Jan 15, 2015

Is this reasonable? What if a user's authentication routine requires I/O?

@hannesm
Copy link
Member

hannesm commented Jan 15, 2015

I'd prefer to not have a user's authentication routine to require I/O. any specific use case in mind?

@dsheets
Copy link
Author

dsheets commented Jan 15, 2015

Logging certificates to disk or implementing something like Perspectives/Convergence are use cases.

@dsheets dsheets changed the title Put X509.Authenticator.authenticate into Lwt.t? Put X509.Authenticator.authenticate into an IO monad? Jan 15, 2015
@dsheets dsheets mentioned this issue Jan 15, 2015
@dsheets
Copy link
Author

dsheets commented Jan 15, 2015

Also SCVP (RFC 5055).

@dsheets
Copy link
Author

dsheets commented Jan 15, 2015

And anything else that does DPD/DPV (RFC 3379).

@dsheets
Copy link
Author

dsheets commented Jan 15, 2015

As we just discussed, exposing an intermediate state value (abstract) would also solve this problem. @pqwy suggested using that approach at a low level and putting a monadic interface on it at a higher level (e.g. TLS).

@pqwy
Copy link
Contributor

pqwy commented Jan 16, 2015

To wrap up:

x509 was split out of, and developed in parallel with ocaml-tls.

We absolutely knew that as some point, we would want the certificate authenticator to do wild things and potentially talk over the network. tls is actually monadic in anticipation of this; the idea was to parameterize over the underlying monad and allow it to be instantiated over Lwt.t, to make it possible to hand off to the cert library smoothly.

But in the course of writing tls, its purity turned out to be an asset more and more. And on the other hand, it currently looks like certificates are the only place in tls where we would want to plug an effect in. So it turns out that the value of converting tls to interop with a side-effecting x509 is not clear.

As x509's primary consumer is ocaml-tls, changes in this library depend on how we shape the other library. There are several ways to mix tls with a side-effecting x509, and it's absolutely on the table, from the beginning.

But please do not expect this do be done too soon; it's fiddly and it's unclear how to do it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants