From c5c59591b0d3e0655e21aff2b73f9adbfe0db091 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Mon, 8 Jul 2019 18:19:52 +0200 Subject: [PATCH] less complaints in conduit-lwt-unix --- lwt-unix/conduit_lwt_tls_real.ml | 1 + lwt-unix/conduit_lwt_unix.ml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lwt-unix/conduit_lwt_tls_real.ml b/lwt-unix/conduit_lwt_tls_real.ml index feb980ab..05eed2be 100644 --- a/lwt-unix/conduit_lwt_tls_real.ml +++ b/lwt-unix/conduit_lwt_tls_real.ml @@ -28,6 +28,7 @@ module Client = struct X509_lwt.authenticator `No_authentication_I'M_STUPID >>= fun authenticator -> let config = Tls.Config.client ~authenticator () in Lwt_unix.connect fd sa >>= fun () -> + let host = Domain_name.host_exn (Domain_name.of_string_exn host) in Tls_lwt.Unix.client_of_fd config ~host fd >|= fun t -> let ic, oc = Tls_lwt.of_t t in (fd, ic, oc) diff --git a/lwt-unix/conduit_lwt_unix.ml b/lwt-unix/conduit_lwt_unix.ml index e829392b..808947ef 100644 --- a/lwt-unix/conduit_lwt_unix.ml +++ b/lwt-unix/conduit_lwt_unix.ml @@ -376,6 +376,7 @@ let endp_to_client ~ctx:_ (endp:Conduit.endp) : client Lwt.t = host (Sexplib.Sexp.to_string_hum (Conduit.sexp_of_endp endp))) end | `Unknown err -> Lwt.fail_with ("resolution failed: " ^ err) + | _ -> assert false let endp_to_server ~ctx (endp:Conduit.endp) = match endp with @@ -392,3 +393,5 @@ let endp_to_server ~ctx (endp:Conduit.endp) = | `Vchan_domain_socket _ as mode -> Lwt.return mode | `TLS (_host, _) -> Lwt.fail_with "TLS to non-TCP currently unsupported" | `Unknown err -> Lwt.fail_with ("resolution failed: " ^ err) + | _ -> assert false +