upstream: github.com/mirage/ca-certs
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-linkedin: apply dune fmt

Pure formatting changes from `dune fmt`: doc comment placement moves
from above the binding to below it for `type`s, multi-line `match`
expressions collapse onto one line where they fit, and infix operator
applications pick up spaces (`Soup.($?)` -> `Soup.( $? )`). No
semantic changes.

+37 -14
+28 -14
README.md
··· 5 5 so they can be used with [ocaml-tls](https://github.com/mirleft/ocaml-tls) 6 6 or any X.509 validation workflow. 7 7 8 - ## Installation 8 + ## Usage 9 9 10 - ``` 11 - opam install ca-certs 12 - ``` 13 - 14 - ## Usage 10 + ### Build a TLS authenticator from the OS trust store 15 11 16 12 ```ocaml 17 - (* Build a TLS authenticator from the OS trust store *) 18 - match Ca_certs.authenticator () with 19 - | Ok authenticator -> 20 - let tls_config = Tls.Config.client ~authenticator () in 21 - (* use tls_config for connections *) 22 - ignore tls_config 23 - | Error (`Msg msg) -> 24 - Format.eprintf "CA detection failed: %s\n" msg 13 + let () = 14 + match Ca_certs.authenticator () with 15 + | Ok authenticator -> 16 + (match Tls.Config.client ~authenticator () with 17 + | Ok tls_config -> ignore tls_config (* use for TLS connections *) 18 + | Error (`Msg msg) -> 19 + Format.eprintf "TLS config failed: %s\n" msg) 20 + | Error (`Msg msg) -> 21 + Format.eprintf "CA detection failed: %s\n" msg 25 22 ``` 26 23 27 24 ## API ··· 32 29 33 30 - `Ca_certs.trust_anchors ()` -- return the PEM-encoded root certificates from 34 31 the OS trust store as a string. 32 + 33 + ## Installation 34 + 35 + Install with opam: 36 + 37 + ```sh 38 + $ opam install ca-certs 39 + ``` 40 + 41 + If opam cannot find the package, it may not yet be released in the public 42 + `opam-repository`. Add the overlay repository, then install it: 43 + 44 + ```sh 45 + $ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git 46 + $ opam update 47 + $ opam install ca-certs 48 + ``` 35 49 36 50 ## Environment Variables 37 51
+2
ca-certs.opam
··· 19 19 "digestif" {>= "1.2.0"} 20 20 "crypto" {>= "1.0.0"} 21 21 "x509" {>= "1.0.0"} 22 + "tls" {with-test} 22 23 "ocaml" {>= "4.13.0"} 23 24 "ohex" {>= "0.2.0"} 24 25 "alcotest" {with-test} 26 + "mdx" {with-test} 25 27 "fmt" {with-test & >= "0.8.7"} 26 28 "odoc" {with-doc} 27 29 ]
+4
dune
··· 1 1 (env 2 2 (dev 3 3 (flags :standard %{dune-warnings}))) 4 + 5 + (mdx 6 + (files README.md) 7 + (libraries ca-certs tls))
+3
dune-project
··· 1 1 (lang dune 3.21) 2 + (using mdx 0.4) 2 3 (name ca-certs) 3 4 4 5 (generate_opam_files true) ··· 14 15 (digestif (>= 1.2.0)) 15 16 (crypto (>= 1.0.0)) 16 17 (x509 (>= 1.0.0)) 18 + (tls :with-test) 17 19 (ocaml (>= 4.13.0)) 18 20 (ohex (>= 0.2.0)) 19 21 (alcotest :with-test) 22 + (mdx :with-test) 20 23 (fmt (and :with-test (>= 0.8.7)))) 21 24 (conflicts (result (< 1.5))) 22 25 (synopsis "Detect root CA certificates from the operating system")