SSL certificate wrong DNS name

I’m trying to the SSL certificates working, but I think something is going wrong with the DNS name for the generate certificate.

I’m running my website in the directory:
In my .env file, the TLD_SUFFIX is set to test.

Now when I access https://www.mydomain.test, I get an invalid certificate issue. When looking at the certificate, the common name is Should that not be mydomain.test?

Is there a way to fix this?

Of course I added the CA to my browser.