Solution 1:

You can use any hostname and IP-address in self signed certificates.

--

Note that using encryption to communicate between services running on the same host provides no security benefit at all and only creates additional overhead...