Skip to content

Commit

Permalink
Update to new tls-eio API
Browse files Browse the repository at this point in the history
  • Loading branch information
talex5 committed Mar 8, 2024
1 parent 197fbb1 commit 5af5fa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions capnp-rpc-net/tls_wrapper.mli
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
open Auth
open Eio.Std

val connect_as_server :
_ Eio.Flow.two_way -> Auth.Secret_key.t option ->
[> Eio.Flow.two_way_ty | Eio.Resource.close_ty] r -> Auth.Secret_key.t option ->
(Endpoint.t, [> `Msg of string]) result

val connect_as_client :
_ Eio.Flow.two_way -> Auth.Secret_key.t Lazy.t -> Digest.t ->
[> Eio.Flow.two_way_ty | Eio.Resource.close_ty] r -> Auth.Secret_key.t Lazy.t -> Digest.t ->
(Endpoint.t, [> `Msg of string]) result
(** [connect_as_client underlying key digest] is an endpoint using flow [underlying].
If [digest] requires TLS, it performs a TLS handshake. It uses [key] as its private key
Expand Down
4 changes: 3 additions & 1 deletion unix/network.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(** A network using TCP and Unix-domain sockets. *)

open Eio.Std

module Location : sig
type t = [
| `Unix of string
Expand Down Expand Up @@ -32,7 +34,7 @@ val v : _ Eio.Net.t -> t

val accept_connection :
secret_key:Capnp_rpc_net.Auth.Secret_key.t option ->
_ Eio.Flow.two_way ->
[> Eio.Flow.two_way_ty | Eio.Resource.close_ty] r ->
(Capnp_rpc_net.Endpoint.t, [> `Msg of string]) result
(** [accept_connection ~switch ~secret_key flow] is a new endpoint for [flow].
If [secret_key] is not [None], it is used to perform a TLS server-side handshake.
Expand Down

0 comments on commit 5af5fa9

Please sign in to comment.