···1616 | _ ->
1717 Error
1818 (`Msg
1919- ( "ca-certs: no trust anchor file found, looked into " ^ path ^ ".\n"
2020- ^ issue ))
1919+ ("ca-certs: no trust anchor file found, looked into " ^ path ^ ".\n"
2020+ ^ issue))
21212222let detect_list paths =
2323 let rec one = function
2424 | [] ->
2525 Error
2626 (`Msg
2727- ( "ca-certs: no trust anchor file found, looked into "
2828- ^ String.concat ", " paths ^ ".\n" ^ issue ))
2727+ ("ca-certs: no trust anchor file found, looked into "
2828+ ^ String.concat ", " paths ^ ".\n" ^ issue))
2929 | path :: paths -> (
3030- match detect_one path with Ok data -> Ok data | Error _ -> one paths )
3030+ match detect_one path with Ok data -> Ok data | Error _ -> one paths)
3131 in
3232 one paths
3333···9595 Bos.OS.Cmd.(run_out cmd |> out_string |> success)
9696 | s -> Error (`Msg ("ca-certs: unknown system " ^ s ^ ".\n" ^ issue))
97979898-let authenticator ?crls ?hash_whitelist () =
9898+let authenticator ?crls ?allowed_hashes () =
9999 let open Rresult.R.Infix in
100100 trust_anchors () >>= fun data ->
101101 let time () = Some (Ptime_clock.now ()) in
···119119 let cas = List.rev cas in
120120 match cas with
121121 | [] -> Error (`Msg ("ca-certs: empty trust anchors.\n" ^ issue))
122122- | _ -> Ok (X509.Authenticator.chain_of_trust ?crls ?hash_whitelist ~time cas)
122122+ | _ -> Ok (X509.Authenticator.chain_of_trust ?crls ?allowed_hashes ~time cas)
+4-4
lib/ca_certs.mli
···11val authenticator :
22 ?crls:X509.CRL.t list ->
33- ?hash_whitelist:Mirage_crypto.Hash.hash list ->
33+ ?allowed_hashes:Mirage_crypto.Hash.hash list ->
44 unit ->
55 (X509.Authenticator.t, [> `Msg of string ]) result
66-(** [authenticator ~crls ~hash_whitelist ()] detects the root CAs (trust
66+(** [authenticator ~crls ~allowed_hashes ()] detects the root CAs (trust
77 anchors) in the operating system's trust store using {!trust_anchors}. It
88 constructs an authenticator with the current timestamp {!Ptime_clock.now},
99- and the provided [~crls] and [~hash_whitelist] arguments, to be used for
1010- {!Tls.Config.client}.
99+ and the provided [~crls] and [~allowed_hashes] arguments. The resulting
1010+ authenticator can be used for {!Tls.Config.client}.
1111 Returns [Error `Msg msg] if detection did not succeed. *)
12121313val trust_anchors : unit -> (string, [> `Msg of string ]) result