erlef / security-wg

Repo for the Security Working Group
https://erlef.github.io/security-wg/
192 stars 17 forks source link

ssl: match_fun example is not supported in mix releases #27

Closed bernardo-martinez closed 1 year ago

bernardo-martinez commented 1 year ago

Hey,

Just to inform you that the elixir examples provided in the ssl section:

match_fun: :public_key.pkix_verify_hostname_match_fun(:https)

are not valid in mix releases given that releases do not accept anonymous functions.

When building the release it results in the following error:

** (Mix) Could not read configuration file. It has invalid configuration terms such as functions, references, and pids. Please make sure your configuration is made of numbers, atoms, strings, maps, tuples and lists. The following entries are wrong:

Thanks for the useful guide!

voltone commented 1 year ago

Correct, the code snippets given here were not intended to be used in config files.

If you wish to move some parts of the :ssl connect configuration options to configuration, I would recommend you only move those things that might change (e.g. :ciphers and :versions). When you call :ssl.connect you then merge those options with the hardcoded defaults (e.g. :match_fun).