From 63aeab5bb98077d4c1b88b7f6dd4cf298d7a83a5 Mon Sep 17 00:00:00 2001 From: Benjamin Canou Date: Wed, 14 Dec 2016 16:45:37 +0100 Subject: [PATCH] RPC: use the external TLS implementation. --- src/node_main.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/node_main.ml b/src/node_main.ml index 3f1a9e1a2..8980f40d6 100644 --- a/src/node_main.ml +++ b/src/node_main.ml @@ -457,8 +457,13 @@ let init_rpc { rpc_addr ; rpc_crt; rpc_key ; cors_origins ; cors_headers } node | Some (addr, port), Some crt, Some key -> lwt_log_notice "Starting the RPC server listening on port %d (TLS enabled)." port >>= fun () -> let dir = Node_rpc.build_rpc_directory node in - let mode = `TLS_native (`Crt_file_path crt, `Key_file_path key, `No_password, `Port port) in + let mode = `TLS (`Crt_file_path crt, `Key_file_path key, `No_password, `Port port) in let host = Ipaddr.to_string addr in + let () = + let old_hook = !Lwt.async_exception_hook in + Lwt.async_exception_hook := function + | Ssl.Read_error _ -> () + | exn -> old_hook exn in RPC_server.launch ~host mode dir cors_origins cors_headers >>= fun server -> Lwt.return (Some server) | Some (_addr, port), _, _ ->