TLS is used for node-node communication. This is fairly tricky to setup with Erlang distribution because you have to generate a full CA and keys for it.
The following script is specific to Fly.io, because it generates a CACert for *.internal domains.
cd rel/overlays/tls
rm -f *.{pem,srl,conf}
# Generate the certificate authority