Allow for supplying cacerts at runtime instead of build time
When building in the Nix sandbox (an environment where the location of cacerts is determined by the SSL_CERT_FILE
environment variable and not by a fixed location), the build of individual dependencies fails, because they can't load the cacerts. This is due to this line in the config.
This for example is the error of the connection
dependency building.
building
** (MatchError) no match of right hand side value: {:error, :enoent}
pubkey_os_cacerts.erl:38: :pubkey_os_cacerts.get/0
/build/hex-source-connection-1.1.0/config/config.exs:131: (file)
(stdlib 4.3.1.2) erl_eval.erl:748: :erl_eval.do_apply/7
(stdlib 4.3.1.2) erl_eval.erl:961: :erl_eval.expr_list/7
(stdlib 4.3.1.2) erl_eval.erl:290: :erl_eval.expr/6
(stdlib 4.3.1.2) erl_eval.erl:282: :erl_eval.expr/6
(stdlib 4.3.1.2) erl_eval.erl:283: :erl_eval.expr/6
I already tried to supply a fix (that works for me), but it doesn't seem to be suitable, as reading from env vars during build seems to be discouraged?
@tcit Suggested to load cacerts at application startup instead.