Skip to content

Commit

Permalink
re-instantiate log message
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Aug 5, 2024
1 parent 7c0e266 commit 3fa5738
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/ca_certs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ let windows_trust_anchors () =
match X509.Certificate.decode_der cert with
| Ok cert -> cert :: acc
| Error (`Msg msg) ->
Log.warn (fun m -> m "Failed to decode a trust anchor: %s" msg);
Log.warn (fun m -> m "Ignoring undecodable trust anchor: %s." msg);
Log.debug (fun m ->
m "Full certificate:@.%a" (Ohex.pp_hexdump ()) cert);
acc)
Expand Down Expand Up @@ -108,13 +108,13 @@ let trust_anchors () =
| s -> Error (`Msg ("ca-certs: unknown system " ^ s ^ ".\n" ^ issue)))

let decode_pem_multiple data =
(* we cannot use [X509.Certificate.decode_pem_multiple] since this fails on the first
undecodable certificate - while we'd like to stay operational, and ignore
some certificates *)
X509.Certificate.fold_decode_pem_multiple
(fun acc -> function Ok t -> t :: acc | Error _ -> acc)
(fun acc -> function
| Ok t -> t :: acc
| Error (`Msg msg) ->
Log.warn (fun m -> m "Ignoring undecodable trust anchor: %s." msg);
acc)
[] data
|> List.rev

let authenticator ?crls ?allowed_hashes () =
let* data = trust_anchors () in
Expand Down

0 comments on commit 3fa5738

Please sign in to comment.