Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d0b77a6

Browse files
authoredSep 27, 2024··
Add CA cert override via env var (#85)
* added ca cert override via env var * quick fix
1 parent 8d7ce94 commit d0b77a6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎lib/rustler_precompiled.ex

+3-2
Original file line numberDiff line numberDiff line change
@@ -924,12 +924,13 @@ defmodule RustlerPrecompiled do
924924
end
925925

926926
# https://erlef.github.io/security-wg/secure_coding_and_deployment_hardening/inets
927-
cacertfile = CAStore.file_path() |> String.to_charlist()
927+
# respects the user provided ca certs via Hex env var
928+
cacertfile = System.get_env("HEX_CACERTS_PATH", CAStore.file_path())
928929

929930
http_options = [
930931
ssl: [
931932
verify: :verify_peer,
932-
cacertfile: cacertfile,
933+
cacertfile: cacertfile |> String.to_charlist(),
933934
# We need to increase depth because the default value is 1.
934935
# See: https://erlef.github.io/security-wg/secure_coding_and_deployment_hardening/ssl
935936
depth: 3,

0 commit comments

Comments
 (0)
Please sign in to comment.