Does this problem happen with the domain in DNS, or only with domains in the /etc/hosts file?
I have 2 subdomains with regular ports not in DNS, one I can use with http, the other not. Both are on the same domain, IP, webserver and the only change in httpd_vhost.conf is the name. Neither works with https. All failures have the same error as shown above. I used a new browser profile in /home/nemo/.local/share/org.sailfishos/browser, with the same results.