# ocaml-tls

> TLS in pure OCaml

**Wikidata**: [Q128618212](https://www.wikidata.org/wiki/Q128618212)  
**Source**: https://4ort.xyz/entity/ocaml-tls

## Summary
**ocaml-tls** is a software library that implements Transport Layer Security (TLS) protocols entirely in the OCaml programming language. Distributed as free software under the 2-clause BSD License, it provides support for TLS versions 1.2 and 1.3. The library is designed to integrate with the OCaml ecosystem without relying on C bindings for its core functionality.

## Key Facts
- **Entity Type:** Software library, Free software
- **Primary Function:** Implementation of Transport Layer Security (TLS)
- **Supported Protocols:** TLS version 1.2 and TLS version 1.3
- **Programming Language:** OCaml
- **License:** 2-clause BSD License
- **Source Repository:** [github.com/mirleft/ocaml-tls](https://github.com/mirleft/ocaml-tls)
- **Initial Stable Release:** Version 0.1.0 released on July 7, 2014
- **Latest Referenced Stable Release:** Version 0.9.0 released on December 23, 2017
- **Aliases:** OCaml-TLS
- **Repology Project Name:** ocaml:tls

## FAQs

### Q: What is ocaml-tls?
A: ocaml-tls is a software library written in pure OCaml that implements the Transport Layer Security (TLS) protocol. It enables secure communication over computer networks for applications built with OCaml.

### Q: Which versions of TLS does ocaml-tls support?
A: The library implements Transport Layer Security version 1.2 and version 1.3.

### Q: What license is ocaml-tls released under?
A: ocaml-tls is distributed as free software under the 2-clause BSD License.

### Q: Where can the source code for ocaml-tls be found?
A: The source code is hosted on GitHub at `github.com/mirleft/ocaml-tls`.

## Why It Matters
ocaml-tls represents a significant development in the domain of secure network programming within the functional programming community. By implementing TLS in "pure" OCaml, the library avoids the need to bind to external C libraries, which are common in other language implementations. This approach leverages the memory safety and strong type system of OCaml, potentially reducing the attack surface associated with memory corruption vulnerabilities often found in lower-level C code.

The library fills a critical infrastructure gap for OCaml developers who require robust encryption for their applications. Its classification as free software under the permissive 2-clause BSD License encourages widespread adoption and modification in both open-source and proprietary projects. The explicit support for modern standards like TLS 1.3 ensures that developers can implement up-to-date cryptographic protections. Furthermore, the availability of detailed design documents and introductory blog posts (such as those on mirage.io) indicates a structured approach to security architecture, providing transparency that is essential for cryptographic software.

## Notable For
- **Pure OCaml Implementation:** Distinct from many bindings that wrap C libraries like OpenSSL, this library implements the TLS protocol logic directly in OCaml.
- **Modern Protocol Support:** Includes implementation of the contemporary TLS 1.3 standard alongside TLS 1.2.
- **Rapid Initial Development:** Released eight distinct stable versions between July 2014 and December 2017.
- **Transparent Design:** The library maintains a public design document (`design.md`) describing its architecture.
- **Integration with MirageOS:** Described and discussed on the MirageOS blog, indicating its role in the unikernel ecosystem.

## Body

### Development and Release History
The development of ocaml-tls has been marked by a series of stable releases tracked on GitHub. The project saw its initial stable release, version 0.1.0, on **July 7, 2014**. Development continued actively over the next three years, resulting in version 0.9.0, released on **December 23, 2017**.

**Key Release Timeline:**
*   **2014-07-07:** Release 0.1.0 (Initial stable version)
*   **2014-10-30:** Release 0.2.0
*   **2015-03-19:** Release 0.4.0
*   **2015-12-04:** Release 0.7.0
*   **2016-03-21:** Release 0.7.1
*   **2017-12-23:** Release 0.9.0

### Technical Specifications
ocaml-tls is classified as a software library and serves as an implementation of the Transport Layer Security protocol. It is built using **OCaml**, an extension of the Caml programming language. The software is copyrighted but freely distributable under the terms of the **2-clause BSD License**.

The library explicitly implements the following protocols:
*   **Transport Layer Security, version 1.2**
*   **Transport Layer Security, version 1.3** (Confirmed via references to MirageOS blog updates regarding TLS 1.3)

### Resources and Documentation
The project maintains its source code at `github.com/mirleft/ocaml-tls`. In addition to code, the project provides documentation regarding its internal structure and design philosophy. A design document is available at `github.com/mirleft/ocaml-tls/blob/main/design.md`. An introductory explanation of the library is also documented at `mirage.io/blog/introducing-ocaml-tls`.

## References

1. [Release 0.1.0. 2014](https://github.com/mirleft/ocaml-tls/releases/tag/0.1.0)
2. [Release 0.2.0. 2014](https://github.com/mirleft/ocaml-tls/releases/tag/0.2.0)
3. [Release 0.3.0. 2014](https://github.com/mirleft/ocaml-tls/releases/tag/0.3.0)
4. [Release 0.4.0. 2015](https://github.com/mirleft/ocaml-tls/releases/tag/0.4.0)
5. [Release 0.5.0. 2015](https://github.com/mirleft/ocaml-tls/releases/tag/0.5.0)
6. [Release 0.6.0. 2015](https://github.com/mirleft/ocaml-tls/releases/tag/0.6.0)
7. [Release 0.7.0. 2015](https://github.com/mirleft/ocaml-tls/releases/tag/0.7.0)
8. [Release 0.7.1. 2016](https://github.com/mirleft/ocaml-tls/releases/tag/0.7.1)
9. [Release 0.8.0. 2017](https://github.com/mirleft/ocaml-tls/releases/tag/0.8.0)
10. [Release 0.9.0. 2017](https://github.com/mirleft/ocaml-tls/releases/tag/0.9.0)
11. [Release 0.9.1. 2018](https://github.com/mirleft/ocaml-tls/releases/tag/0.9.1)
12. [Release 0.9.2. 2018](https://github.com/mirleft/ocaml-tls/releases/tag/0.9.2)
13. [Release 0.9.3. 2019](https://github.com/mirleft/ocaml-tls/releases/tag/0.9.3)
14. [Release 0.10.0. 2019](https://github.com/mirleft/ocaml-tls/releases/tag/0.10.0)
15. [Release 0.10.1. 2019](https://github.com/mirleft/ocaml-tls/releases/tag/0.10.1)
16. [Release 0.10.2. 2019](https://github.com/mirleft/ocaml-tls/releases/tag/0.10.2)
17. [Release 0.10.3. 2019](https://github.com/mirleft/ocaml-tls/releases/tag/0.10.3)
18. [Release 0.10.4. 2019](https://github.com/mirleft/ocaml-tls/releases/tag/0.10.4)
19. [Release 0.10.5. 2019](https://github.com/mirleft/ocaml-tls/releases/tag/v0.10.5)
20. [Release 0.10.6. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.10.6)
21. [Release 0.11.0. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.11.0)
22. [Release 0.11.1. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.11.1)
23. [Release 0.12.0. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.12.0)
24. [Release 0.12.1. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.12.1)
25. [Release 0.12.2. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.12.2)
26. [Release 0.12.3. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.12.3)
27. [Release 0.12.4. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.12.4)
28. [Release 0.12.5. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.12.5)
29. [Release 0.12.6. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.12.6)
30. [Release 0.12.7. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.12.7)
31. [Release 0.12.8. 2020](https://github.com/mirleft/ocaml-tls/releases/tag/v0.12.8)
32. [Release 0.13.0. 2021](https://github.com/mirleft/ocaml-tls/releases/tag/v0.13.0)
33. [Release 0.13.1. 2021](https://github.com/mirleft/ocaml-tls/releases/tag/v0.13.1)
34. [Release 0.13.2. 2021](https://github.com/mirleft/ocaml-tls/releases/tag/v0.13.2)
35. [Release 0.14.0. 2021](https://github.com/mirleft/ocaml-tls/releases/tag/v0.14.0)
36. [Release 0.14.1. 2021](https://github.com/mirleft/ocaml-tls/releases/tag/v0.14.1)
37. [Release 0.15.0. 2021](https://github.com/mirleft/ocaml-tls/releases/tag/v0.15.0)
38. [Release 0.15.1. 2021](https://github.com/mirleft/ocaml-tls/releases/tag/v0.15.1)
39. [Release 0.15.2. 2021](https://github.com/mirleft/ocaml-tls/releases/tag/v0.15.2)
40. [Release 0.15.3. 2022](https://github.com/mirleft/ocaml-tls/releases/tag/v0.15.3)
41. [Release 0.15.4. 2022](https://github.com/mirleft/ocaml-tls/releases/tag/v0.15.4)
42. [Release 0.15.5. 2022](https://github.com/mirleft/ocaml-tls/releases/tag/v0.15.5)
43. [Release 0.16.0. 2023](https://github.com/mirleft/ocaml-tls/releases/tag/v0.16.0)
44. [Release 0.17.0. 2023](https://github.com/mirleft/ocaml-tls/releases/tag/v0.17.0)
45. [Release 0.17.1. 2023](https://github.com/mirleft/ocaml-tls/releases/tag/v0.17.1)
46. [Release 0.17.2. 2023](https://github.com/mirleft/ocaml-tls/releases/tag/v0.17.2)
47. [Release 0.17.3. 2023](https://github.com/mirleft/ocaml-tls/releases/tag/v0.17.3)
48. [Release 0.17.4. 2024](https://github.com/mirleft/ocaml-tls/releases/tag/v0.17.4)
49. [Release 0.17.5. 2024](https://github.com/mirleft/ocaml-tls/releases/tag/v0.17.5)
50. [Release 1.0.0. 2024](https://github.com/mirleft/ocaml-tls/releases/tag/v1.0.0)