Everything works fine when I try to access my website at *.com and I do get secure connection, but trying to open www.*.com leads to unsecure connection saying that my certificate is not valid, and it is self-signed.
I am deploying this using an AWS EC2 instance and I do have a CNAME record there which should make the www.*.com be an alias of *.com.