# Windows support for nocrypto

**URL:** <https://discuss.ocaml.org/t/windows-support-for-nocrypto/3836>\
**Category:** Ecosystem\
**Tags:** esy\
**Created:** [May 22, 2019, 6:00pm UTC](https://discuss.ocaml.org/t/windows-support-for-nocrypto/3836 "2019-05-22T18:00:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ulrikstrid](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ulrikstrid/32/1600_2.png) [@ulrikstrid](https://discuss.ocaml.org/u/ulrikstrid)\
**Post date:** [May 22, 2019, 6:00pm UTC](https://discuss.ocaml.org/t/windows-support-for-nocrypto/3836/1 "2019-05-22T18:00:19Z")

</div>

Hello

I’ve spent a pretty significant time trying to get a web server project to compile on Windows.  
It uses `ocaml-tls`, `http/af`, `ocaml-h2` and `ocaml-jwt` which have proven to be quite difficult.

The last step that I’ve worked on the last few days is to get nocrypto to work on Windows.  
I opened [this PR to the nocrypto project](https://github.com/mirleft/ocaml-nocrypto/pull/162) that is a initially working version. I know that the code can’t be merged in its current state but at least it’s out there for discussion.

With these changes I have a project that in theory can serve web pages over https, but since I’m using `ocaml-h2` eliptic curves are needed in `ocaml-tls` before I can use that all the way.

If anyone is interested [this is the project](https://github.com/ulrikstrid/reason-oidc-provider/) that I’m working on while doing this. I’m using the `esy` package manager and the Windows-specific stuff is in `windows.json` which basically extends the `esy.json`.

I’ll start a move to `ocaml-ssl` of the project but will still need nocrypto for `jwt`. I am however doing Windows support mostly for fun and to unlock more developers to find these amazing languages so I’m not in anyway blocked by this.

---

<div class="post-metadata">

**Author:** ![keleshev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/keleshev/32/3779_2.png) [@keleshev](https://discuss.ocaml.org/u/keleshev)\
**Post date:** [May 23, 2019, 10:55am UTC](https://discuss.ocaml.org/t/windows-support-for-nocrypto/3836/2 "2019-05-23T10:55:18Z")

</div>

Hi Ulrik, this is a cool achievement. I remember, in summer '18 I made a web server on Windows based on cohttp, lwt, and dune (and about 40 transitive dependencies). Back then http/af didn’t have lwt support, so it was far away from being able to run on Windows, so I’m really glad to hear that it works now.

---

<div class="post-metadata">

**Author:** ![hannes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/hannes/32/2302_2.png) [@hannes](https://discuss.ocaml.org/u/hannes)\
**Post date:** [May 26, 2019, 10:20am UTC](https://discuss.ocaml.org/t/windows-support-for-nocrypto/3836/3 "2019-05-26T10:20:43Z")

</div>

this is nice! I briefly looked into your RNG integration code for windows, and left a comment.

> [@ulrikstrid](#):
>
> eliptic curves are needed in `ocaml-tls`

there is (unreleased) ECC code, interfacing [fiat](https://github.com/mit-plv/fiat-crypto/) ([mirage/fiat](https://github.com/mirage/fiat/)) and [hacl](https://github.com/project-everest/hacl-star/) ([mirage/hacl](https://github.com/mirage/hacl/)) – which is used by my [OCaml-TLS 1.3 branch](https://github.com/hannesm/ocaml-tls). This will hopefully end up in opam-repository soon.

---

<div class="post-metadata">

**Author:** ![ulrikstrid](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ulrikstrid/32/1600_2.png) [@ulrikstrid](https://discuss.ocaml.org/u/ulrikstrid)\
**Post date:** [May 26, 2019, 12:26pm UTC](https://discuss.ocaml.org/t/windows-support-for-nocrypto/3836/4 "2019-05-26T12:26:53Z")

</div>

Thanks for the comments! I’ll update the PR when I have time, also left a answer on GitHub.

The 1.3 branch is super interesting since I’m having issues compiling openssl statically for my Docker container.

---

<div class="post-metadata">

**Author:** ![avsm](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/avsm/32/6_2.png) [@avsm](https://discuss.ocaml.org/u/avsm)\
**Post date:** [May 26, 2019, 5:13pm UTC](https://discuss.ocaml.org/t/windows-support-for-nocrypto/3836/5 "2019-05-26T17:13:22Z")

</div>

ocaml-tls will definitely support static linking via dune when that’s merged, since it’s necessary for MirageOS compilation to embedded targets like xen/solo5.
