What has /etc/hosts got to do with valid TLS certificates? I think that’s a non-sequitur.
You don't need to setup one cert for 127.0.0.1 as stated by the parent comment.
You don't need to setup one cert for 127.0.0.1 as stated by the parent comment.