@@ -375,13 +375,38 @@ defmodule Mix do
375
375
376
376
$ MIX_DEBUG=1 mix compile
377
377
378
- In addition, Mix also uses the following environment variables defined by other libraries
378
+ ## SSL certificates
379
+
380
+ Mix and the Hex package manager use the default operating system certificates
381
+ when downloading resources. In certain situations, such as when running behind
382
+ proxies, you want to replace those certificates.
383
+
384
+ If you simply want to change the certificates used by Mix and Hex, you may set
385
+ the `HEX_CACERTS_PATH` environment variable, pointing to a CA certificate file.
386
+ See [`mix hex.config`](https://hexdocs.pm/hex/Mix.Tasks.Hex.Config.html#module-config-keys).
387
+
388
+ From Erlang/OTP 27.2, it is also possible to change the certificates for your
389
+ project as a whole. To do so, you might add the following to your `config/config.exs`:
390
+
391
+ config :public_key, :cacerts_path, "/path/to/certs.pem"
392
+
393
+ You can also do so by setting the `ERL_AFLAGS` and `ERL_ZFLAGS` environment variables:
394
+
395
+ ```bash
396
+ ERL_AFLAGS="-public_key cacerts_path '\" /path/to/certs.pem\" '"
397
+ ERL_ZFLAGS="-public_key cacerts_path '\" /path/to/certs.pem\" '"
398
+ ```
399
+
400
+ You can verify if the configuration has been properly set by calling the following
401
+ inside `iex -S mix`:
402
+
403
+ Application.load(:public_key)
404
+ Application.get_env(:public_key, :cacerts_path)
405
+
406
+ And by loading the certificates:
407
+
408
+ :public_key.cacerts_get()
379
409
380
- * `HEX_CACERTS_PATH` - use specified CA certificate file instead of default
381
- system CA certificates. This configures how HTTPS calls are made via
382
- [Erlang `ssl` module](https://www.erlang.org/doc/apps/ssl/ssl.html#t:client_option_cert/0)
383
- to fetch remote archives and packages. For more details, see
384
- [`mix hex.config`](https://hexdocs.pm/hex/Mix.Tasks.Hex.Config.html#module-config-keys).
385
410
"""
386
411
387
412
@ mix_install_project __MODULE__ . InstallProject
0 commit comments