You cannot do this. As a practical matter, you can only have one wildcard in a certificate DNS name, and it must be in the position furthest to the left.
Some options:
- Make
auth
a reserved name in your environment, and instead design your system to use SOME_ID.auth.example.com
(*.auth.example.com
is a valid wildcard certificate).
- Design your services to use a prefix, so the name is at the same level:
auth-SOME_ID.example.com
. Then a simple *.example.com
wildcard certificate will cover you.
- Build infrastructure to request new certificates as needed from a provider like LetsEncrypt.org for the specific
auth.SOME_ID.example.com
addresses you need.
There are others, as well. For example, you could become your own Certificate Authority... though this is almost certainly more trouble than it's worth if you want these certs publicly trusted. The main point is you'll need to look at another way to accomplish this. It'll take some thought, but it's not impossible.