# Problem with cohttp 6.3

**URL:** <https://discuss.ocaml.org/t/problem-with-cohttp-6-3/18614>\
**Category:** Community\
**Created:** [October 13, 2026, 9:37am UTC](https://discuss.ocaml.org/t/problem-with-cohttp-6-3/18614 "2026-10-13T09:37:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdagnat](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/fdagnat/32/88_2.png) [@fdagnat](https://discuss.ocaml.org/u/fdagnat)\
**Post date:** [October 13, 2026, 9:37am UTC](https://discuss.ocaml.org/t/problem-with-cohttp-6-3/18614/1 "2026-10-13T09:37:32Z")

</div>

Hello,

Trying to execute a code that was working before raise an exception ```Fatal error: exception Invalid_argument(“Failed to set protocol version”)```.

Tracking the problem, it comes from a simple ```Cohttp_lwt_unix.Client.get```call.

Restarting from the tutorial for a simple get of the cohttp README. I get exactly the same error. I use opam with:

**cohttp** (6.3.0), **cohttp-lwt** (6.3.0), **cohttp-lwt-unix** (6.3.0), **tls-lwt (2.1.3)**

Can anyone may point me to the possible source of such a problem?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![patricoferris](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/patricoferris/32/3621_2.png) [@patricoferris](https://discuss.ocaml.org/u/patricoferris)\
**Post date:** [October 13, 2026, 1:22pm UTC](https://discuss.ocaml.org/t/problem-with-cohttp-6-3/18614/2 "2026-10-13T13:22:08Z")

</div>

Hi @fdagnat,

It would seem you are hitting an issue whereby [conduit](https://github.com/mirage/ocaml-conduit) is selecting the non-“native” SSL backend (i.e. using `lwt_ssl` alongside the [ssl](https://github.com/savonet/ocaml-ssl/) bindings) which is where that exception is being raised: [ocaml-ssl/src/ssl\_stubs.c at 2f36b4d50632261d309af7d2e749a4025ad3c167 · savonet/ocaml-ssl · GitHub](https://github.com/savonet/ocaml-ssl/blob/2f36b4d50632261d309af7d2e749a4025ad3c167/src/ssl_stubs.c#L376).

To immediately see if this is the issue, you can try running your code with `CONDUIT_TLS=native` which should select the pure OCaml TLS stack. Alternatively, you could uninstall `lwt_ssl` and `ssl` too.

Copying in @toots who I think maintains the SSL bindings library. It might be worth opening an issue with more information on the bindings @fdagnat.

---

<div class="post-metadata">

**Author:** ![fdagnat](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/fdagnat/32/88_2.png) [@fdagnat](https://discuss.ocaml.org/u/fdagnat)\
**Post date:** [October 13, 2026, 1:55pm UTC](https://discuss.ocaml.org/t/problem-with-cohttp-6-3/18614/3 "2026-10-13T13:55:35Z")

</div>

Hello,

Thanks for the hint. Indeed, removing **lwt\_ssl solves the problem.**

But, if **lwt\_ssl is installed, setting the** CONDUIT\_TLS environment variable to native still raises the exception.

I am going to open an issue on the lwt\_ssl github repo.
