Commit dcb959260063a6102a2f315ac5d31f8fcd857c32

Andreas Rydbrink 2022-02-11T23:50:33

Add overridable cacertfile (#21)

diff --git a/lib/dart_sass.ex b/lib/dart_sass.ex
index 07713f2..186bcaa 100644
--- a/lib/dart_sass.ex
+++ b/lib/dart_sass.ex
@@ -364,7 +364,7 @@ defmodule DartSass do
     end
 
     # https://erlef.github.io/security-wg/secure_coding_and_deployment_hardening/inets
-    cacertfile = CAStore.file_path() |> String.to_charlist()
+    cacertfile = cacertfile() |> String.to_charlist()
 
     http_options = [
       autoredirect: false,
@@ -395,4 +395,8 @@ defmodule DartSass do
         raise "couldn't fetch #{url}: #{inspect(other)}"
     end
   end
+
+  defp cacertfile() do
+    Application.get_env(:dart_sass, :cacerts_path) || CAStore.file_path()
+  end
 end