Castore
A portable pure OCaml CA Store
Install / Use
/learn @suri-framework/CastoreREADME
CAStore 🦫
A portable pure OCaml CA Store, with no dependencies, inspired by Elixir's :castore.
Getting Started
First, install castore in your switch:
# latest published version
opam install castore
# latest development version
opam pin castore git+https://github.com/leostera/castore
Now we can add it to your dune project dependencies:
(package
;...
(depends
(castore (>= "0.0.0"))
;...)
;...)
And to your dune stanzas:
(executable
(name my_app)
(libraries castore))
And finally we can use it by decoding the certificates, and building a chain of trust we can build our Tls config with.
Here's an example of how to do it:
<!-- $MDX file=decode_test.ml,part=main -->let decode_pem ca =
let ca = Cstruct.of_string ca in
let cert = X509.Certificate.decode_pem ca in
Result.get_ok cert
in
let cas = List.map decode_pem Ca_store.certificates in
let authenticator = X509.Authenticator.chain_of_trust ~time cas in
(* ... *)
Acknowledgements
This project would not be possible without ocaml-tls and ca-certs, in fact,
we use ca-certs to generate the Ca_store.cas with code taken from the
implementation of ca-certs.
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
