jhn_cacerts (jhn_stdlib v5.10.2)
View SourceA cacerts utility lib: This lib will download cacerts from https://mkcert.org/generate/, if not possible it will use a list provided in the application priv-dir.
To get the list call fetch/0 and the list will the first downloaded the the first time and then stored a presistent term for speedy retrieval.
To trigger a download when/storage the actual list is not needed use the load/0 function.
If you want to have regular updated of the list call the start_link/0 or start_link/1 functions that will start a jhn_server and update the list at regular intervalls, once every 24 hours for start_link/0 and every interval milli-seconds for start_link(Interval).
The CaCerts list is comppatible with the cacerts option of the ssl libs.
Summary
Functions
Provides the cacert list, takes longer time on firs invvocation.
Downloads and stores the cacert list.
Starts a linked jhn_server that updates the cacert list every 24 hours, equivalent to start_link(86_400_000).
Starts a linked jhn_server that updates the cacert list every Interval milli-seconds,
Functions
-spec fetch() -> [binary()] | {error, _}.
Provides the cacert list, takes longer time on firs invvocation.
-spec load() -> ok | {error, _}.
Downloads and stores the cacert list.
-spec start_link() -> {ok, pid()} | ignore | {error, _}.
Starts a linked jhn_server that updates the cacert list every 24 hours, equivalent to start_link(86_400_000).
-spec start_link(pos_integer()) -> {ok, pid()} | ignore | {error, _}.
Starts a linked jhn_server that updates the cacert list every Interval milli-seconds,