Observation:
$ mix phx.gen.cert
* creating priv/cert/selfsigned_key.pem
* creating priv/cert/selfsigned.pem
If you have not already done so, please update your HTTPS Endpoint
configuration in lib/_web/config/dev.exs:
config nil, Web.Endpoint,
http: [port: 4000],
https: [
port: 4001,
certfile: "priv/cert/selfsigned.pem",
keyfile: "priv/cert/selfsigned_key.pem"
],
...
# ...a word of warning follows, not copy-pasted...
Aside from the nil
in the config
snippet which is easy to catch (but should still be fixed), I had a slight WTF actually pointing my web app to the generated self-signed certificates. They rest comfortably in my $UMBRELLA_ROOT/priv/cert/
directory and me copy-pasting the above snippet in apps/myapp_web/config/dev.exs
is looking for them in $UMBRELLA_ROOT/_build/dev/lib/myapp_web/priv/cert/selfsigned_key.pem
. OK, I just move them to apps/lib/myapp_web/priv/certs/
and recompile. The local SSL listener works.
The generator should probably be umbrella-aware when offering help. It was easy to fix the error but I imagine it would catch off-guard somebody who is in a rush.