Closed ngeraedts closed 2 years ago
@ngeraedts a PR to add ssl customization is welcome. If you prefer, you can also install it manually via the steps here: https://github.com/phoenixframework/esbuild/blob/main/lib/esbuild.ex#L28 - your call!
Can confirm that the code snippet still works because I ran into the same problem.
There's a slight chicken-and-egg bootstrapping problem though because I also have to add the cacertfile
item to this project's config/config.exs
or I can't even run mix test
, so maybe going a route like HEX_CACERTS_PATH
(maybe alternatively, but which takes precedence) makes sense?
With the latest version of Phoenix I did the following in dev.exs
to supply a custom CA cert
config :esbuild,
cacerts_path: "/path/to/ca/cert/file.pem"
Just ran into this issue - with the introduction of tailwind, I had to add a line in for that one as well. So, with the rebuild config line that @meadoch1 described, it looks like this:
config :esbuild, cacerts_path: "/path/to/ca/cert/file.pem"
config :tailwind, cacerts_path: "/path/to/ca/cert/file.pem"
In my case, I needed to point to some Netskope MITM certs provided by my company. Im wondering if there are any global settings so it doesn't have to be specified multiple times.
I was trying to get esbuild installed in our Phoenix project, but ran into the following error:
Our company uses a MitM firewall application (yay 🙄 ), so we need to specify our own certificate bundle when making outbound requests. I was able to work around this by adding my own
:cacertfile
config parameter (and setting it appropriately):And then edited
lib/esbuild.ex
with the following in place of esbuild.ex:#L266-L275:Is this configuration something that could be included in the project? I'd be happy to submit this as a PR and address review comments.
Let me know if you need any more details.