RPC: use the external TLS implementation.

This commit is contained in:
Benjamin Canou 2016-12-14 16:45:37 +01:00
parent 8360b4e407
commit 63aeab5bb9

View File

@ -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 -> | Some (addr, port), Some crt, Some key ->
lwt_log_notice "Starting the RPC server listening on port %d (TLS enabled)." port >>= fun () -> 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 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 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 -> RPC_server.launch ~host mode dir cors_origins cors_headers >>= fun server ->
Lwt.return (Some server) Lwt.return (Some server)
| Some (_addr, port), _, _ -> | Some (_addr, port), _, _ ->