`No SSL or TLS support compiled into Conduit` with cohttp 5.3.1, conduit 6.2.1, tls 0.17.4

I’m having issues connecting to an HTTPS service in my application that
is using cohttp and conduit. I get:

Fatal error: exception Failure("No SSL or TLS support compiled into Conduit")

My opam file declares dependencies on tls and cohttp-lwt-unix.
The resulting set of packages installed are (excerpt):

$ opam list | grep 'cohttp\|conduit\|tls' 
cohttp                  5.3.1       An OCaml library for HTTP clients and servers
cohttp-lwt              5.3.0       CoHTTP implementation using the Lwt concurrency library
cohttp-lwt-unix         5.3.0       CoHTTP implementation for Unix and Windows using Lwt
conduit                 6.2.1       A network connection establishment library
conduit-lwt             6.2.1       A portable network connection establishment library using Lwt
conduit-lwt-unix        6.2.1       A network connection establishment library for Lwt_unix
tls                     0.17.4      Transport Layer Security purely in OCaml

I can make it work by adding the following constraints:

  "tls" { < "1.33.0" }
  "cohttp-lwt-unix" { < "4.1.0" }

giving me:

$ opam list | grep 'cohttp\|conduit\|tls'               
cohttp                  4.0.0       An OCaml library for HTTP clients and servers
cohttp-lwt              4.0.0       CoHTTP implementation using the Lwt concurrency library
cohttp-lwt-unix         4.0.0       CoHTTP implementation for Unix and Windows using Lwt
conduit                 4.0.2       A network connection establishment library
conduit-lwt             4.0.2       A portable network connection establishment library using Lwt
conduit-lwt-unix        4.0.2       A network connection establishment library for Lwt_unix
tls                     0.15.4      Transport Layer Security purely in OCaml

but it doesn’t feel like a satisfying solution. What am I doing wrong?

I see conduit-lwt-unix has a depopt on tls-lwt. It seems you don’t have tls-lwt installed. Maybe you need to install that package?

That indeed solves the problem. Thanks!

Users often ask for what kind of contributions they could make. A super-high contribution impact would be to change this error message to suggest installing tls-lwt or lwt_ssl.

1 Like

True, I was coming here to suggest something similar. I also noted that this is actually documented in cohttp’s README.md. I’ll see about the PR on conduit. Edit: opened an issue on Conduit.

2 Likes