I haven't used it, but I think `mkcert` is the go to solution for this. [0]

[0]: https://github.com/FiloSottile/mkcert