I also faced the simmilar issue, in my case, I had ssl certificate installed for mydomain.com but not for www.mydomain.com (I'm using certbot with nginx). after installing for www.mydomain.com it worked.