The certificates are installed by default by the Qlik installation.
At times due to the improper host name given while installation, installs wrong certificates. which stops Qlik Sense access using the hostname.
Something similar is in your case where access with hostname is not allowed but with localhost and may be with IP address it is allowed.
Try below steps.
1. Stop All the services.
2. Table backup of the certificates installed.
3. Delete the certificate
4. Restart the services.
And try login using the hostname.