package capnp-rpc-net
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Cap'n Proto is a capability-based RPC system with bindings for many languages
Install
dune-project
Dependency
Authors
Maintainers
Sources
capnp-rpc-2.1.1.tbz
sha256=6e9675034c8eac5873ed511f9b968db5223278145bb02ac4a970053a53970a48
sha512=2e2eb8389071bdad3ceef1d15200bf28987f13319f754f4d1603828d0d79202b4de90a6eb294f12ee088c7e3b73755286fbe7076b8fd3d0b29644221e0e7e080
doc/src/capnp-rpc-net/tls_wrapper.ml.html
Source file tls_wrapper.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40module Log = Capnp_rpc.Debug.Log open Auth let error fmt = fmt |> Fmt.kstr @@ fun msg -> Error (`Msg msg) let plain_endpoint flow = Endpoint.of_flow ~peer_id:Auth.Digest.insecure flow let connect_as_server flow secret_key = match secret_key with | None -> Ok (plain_endpoint flow) | Some key -> Log.info (fun f -> f "Doing TLS server-side handshake..."); let tls_config = Secret_key.tls_server_config key in match Tls_eio.server_of_flow tls_config flow with | exception (Failure msg) -> error "TLS connection failed: %s" msg | exception ex -> Eio.Fiber.check (); error "TLS connection failed: %a" Fmt.exn ex | flow -> match Tls_eio.epoch flow with | Error () -> failwith "Unknown error getting TLS epoch data" | Ok data -> match data.Tls.Core.peer_certificate with | None -> error "No client certificate found" | Some client_cert -> let peer_id = Digest.of_certificate client_cert in Ok (Endpoint.of_flow ~peer_id flow) let connect_as_client flow secret_key auth = match Digest.authenticator auth with | None -> Ok (plain_endpoint flow) | Some authenticator -> let tls_config = Secret_key.tls_client_config ~authenticator (Lazy.force secret_key) in Log.info (fun f -> f "Doing TLS client-side handshake..."); match Tls_eio.client_of_flow tls_config flow with | exception (Failure msg) -> error "TLS connection failed: %s" msg | exception ex -> Eio.Fiber.check (); error "TLS connection failed: %a" Fmt.exn ex | flow -> Ok (Endpoint.of_flow ~peer_id:auth flow)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>