Introducing s2n, a New Open-Source TLS Implementation
If I counted right:<p><pre><code>  OCaml TLS: ~4400 LoC
  OCaml X509: ~1550 LoC
  OCaml ASN1: ~1400 LoC
  OCaml nocrypto: ~5250 LoC
</code></pre>
Total ~12600 LoC but you get a fully self-contained implementation, having only some crypto code in C and the rest as pure OCaml:<p><a href="https://mirage.io/blog/why-ocaml-tls" rel="nofollow">https://mirage.io/blog/why-ocaml-tls</a>
<a href="https://mirage.io/blog/announcing-mirage-25-release" rel="nofollow">https://mirage.io/blog/announcing-mirage-25-release</a>