From 7535ccdb3cfb91258a613e41ddb56171bb080099 Mon Sep 17 00:00:00 2001 From: Filipe Marques Date: Thu, 29 Aug 2024 10:19:35 +0200 Subject: [PATCH] Improve error message for missing SSL/TLS support --- src/conduit-lwt-unix/conduit_lwt_unix.ml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/conduit-lwt-unix/conduit_lwt_unix.ml b/src/conduit-lwt-unix/conduit_lwt_unix.ml index ef53d46c..d60f2da8 100644 --- a/src/conduit-lwt-unix/conduit_lwt_unix.ml +++ b/src/conduit-lwt-unix/conduit_lwt_unix.ml @@ -311,7 +311,11 @@ let connect_with_default_tls ~ctx tls_client_config = match !tls_library with | OpenSSL -> connect_with_openssl ~ctx tls_client_config | Native -> connect_with_tls_native ~ctx tls_client_config - | No_tls -> Lwt.fail_with "No SSL or TLS support compiled into Conduit" + | No_tls -> + Lwt.fail_with + "No SSL or TLS support compiled into Conduit. You must install it \ + through opam with one of these commands: `opam install lwt_ssl` or \ + `opam install tls-lwt`" (** Main connection function *) @@ -368,7 +372,11 @@ let serve_with_default_tls ?timeout ?stop ~ctx ~certfile ~keyfile ~pass ~port | Native -> serve_with_tls_native ?timeout ?stop ~ctx ~certfile ~keyfile ~pass ~port callback - | No_tls -> failwith "No SSL or TLS support compiled into Conduit" + | No_tls -> + failwith + "No SSL or TLS support compiled into Conduit. You must install it \ + through opam with one of these commands: `opam install lwt_ssl` or \ + `opam install tls-lwt`" let serve ?backlog ?timeout ?stop ~on_exn ~(ctx : ctx) ~(mode : server) callback =