From 183d1c9e5815b18c1717b8a2ea8646aa9d776d6d Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Tue, 23 Oct 2018 00:40:39 +0200 Subject: [PATCH] toplevel for tls endpoint, client fixes --- app/vmm_client.ml | 12 +++--------- app/vmm_tls_endpoint.ml | 5 +++++ pkg/pkg.ml | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/vmm_client.ml b/app/vmm_client.ml index 51e6681..bebe90f 100644 --- a/app/vmm_client.ml +++ b/app/vmm_client.ml @@ -4,16 +4,10 @@ open Lwt.Infix let rec read_tls_write_cons t = Vmm_tls.read_tls t >>= function - | Error (`Msg msg) -> - Logs.err (fun m -> m "error while reading %s" msg) ; - read_tls_write_cons t | Error _ -> Logs.err (fun m -> m "exception while reading") ; Lwt.return_unit - | Ok data -> - match Vmm_commands.log_pp_reply data with - | Ok () -> read_tls_write_cons t - | Error (`Msg msg) -> - Logs.warn (fun m -> m "error %s while logging message" msg) ; - read_tls_write_cons t + | Ok wire -> + Logs.app (fun m -> m "%a" Vmm_asn.pp_wire wire) ; + read_tls_write_cons t let client cas host port cert priv_key = Nocrypto_entropy_lwt.initialize () >>= fun () -> diff --git a/app/vmm_tls_endpoint.ml b/app/vmm_tls_endpoint.ml index 633e66e..852e090 100644 --- a/app/vmm_tls_endpoint.ml +++ b/app/vmm_tls_endpoint.ml @@ -165,3 +165,8 @@ let port = let doc = "TCP listen port" in Arg.(value & opt int 1025 & info [ "port" ] ~doc) +let cmd = + Term.(ret (const jump $ setup_log $ cacert $ cert $ key $ port)), + Term.info "vmm_tls_endpoint" ~version:"%%VERSION_NUM%%" + +let () = match Term.eval cmd with `Ok () -> exit 0 | _ -> exit 1 diff --git a/pkg/pkg.ml b/pkg/pkg.ml index 07b8ee9..42012cc 100644 --- a/pkg/pkg.ml +++ b/pkg/pkg.ml @@ -10,7 +10,7 @@ let () = Pkg.bin "app/vmmd" ; Pkg.bin "app/vmm_console" ; Pkg.bin "app/vmm_log" ; - (* Pkg.bin "app/vmm_client" ; *) + Pkg.bin "app/vmm_client" ; Pkg.bin "app/vmm_tls_endpoint" ; Pkg.bin "app/vmmc" ; Pkg.bin "provision/vmm_req_command" ;