haskell-tls / hs-certificate

Certificate and Key Reader/Writer in haskell
60 stars 57 forks source link

Make x509-validation.cabal depend less on "IO" and be more pure. #32

Closed alexanderkjeldaas closed 9 years ago

alexanderkjeldaas commented 10 years ago

If I may come with a feature request, it seems that x509-validation.cabal depends on a lot of IO-libraries like filepath, process, network.

I would like to be able to cross-compile the x509 handling to javascript, and thus having a "pure" package would help.

vincenthz commented 9 years ago

As much as I like cross compilation from hs to javascript, x509 validation requires lots of IO stuff to actually happens (CRL, OSCP, access to system store, ..) so I don't think that's a realistic goal.

alexanderkjeldaas commented 9 years ago

That makes sense. How about wrapping all of that in a few typeclasses? Then instead of using IO you would require that typeclass.

Then there could be three implementations of that typeclass. One mock for testing, one for a javascript implementation, and one which maps to the current implementation.

vincenthz commented 9 years ago

Come to think of it, many thinks are already in hooks, and I'm happy to accept more hooks to achieve goals to make it more javascript friendly.