Skip to content

Commit 89c51b1

Browse files
committed
adapt to API change (Tls.Config.{client,server} may result in an error)
1 parent 77ea165 commit 89c51b1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

miou/tests/fuzz.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ let run seed operations =
261261
Rresult.R.failwith_error_msg (Ca.make fuzz_coop seed)
262262
in
263263
let cfg_server =
264-
Tls.Config.server ~certificates:(`Single ([ cert ], pk)) ()
264+
Result.get_ok (Tls.Config.server ~certificates:(`Single ([ cert ], pk)) ())
265265
in
266-
let cfg_client = Tls.Config.client ~authenticator () in
266+
let cfg_client = Result.get_ok (Tls.Config.client ~authenticator ()) in
267267
let to_client, to_server = List.split operations in
268268
let stop = Stop.create () in
269269
let prm0 = Miou.async @@ fun () -> run_server ~to_server ~stop fd cfg_server in

miou/tls_miou_unix.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ let resolve host service =
293293
| ai :: _ -> ai.ai_addr
294294

295295
let connect authenticator (v, port) =
296-
let conf = Tls.Config.client ~authenticator () in
296+
let conf =
297+
match Tls.Config.client ~authenticator () with
298+
| Ok config -> config
299+
| Error `Msg msg -> Fmt.invalid_arg "Configuration failure: %s" msg
300+
in
297301
let addr = resolve v (string_of_int port) in
298302
let fd =
299303
match addr with

0 commit comments

Comments
 (0)