I am experiencing the same issue here with a new 3.1.3 installation. A couple comments:
This might be more than a more than a certificate issue. When Chrome and FF have an issue with your SSL certificate, they will usually tell you about it. This is causing a timeout in the browser!
Looks like the certificate is signed with SHA-256 with RSA Encryption ( 1.2.840.113549.1.1.11 ), so that is fine. Then, there's the issue of the certificate being self-signed at all, which throws errors but should NOT prevent the user from accessing the site if they tell the browser they trust the certificate. In this case, there's something else happenging. Late last year/early this year, browsers started checking for subject alternate names in certain scenarios for self-signed certificates. I'm seeing that is the case here in developer tools security tab when viewing the site in Google Chrome. Chrome dev tools says:
```This page is not secure (broken HTTPS).
Certificate - Subject Alternative Name missing
The certificate for this site does not contain a Subject Alternative Name extension containing a domain name or IP address.
View certificate
Certificate - missing
This site is missing a valid, trusted certificate (net::ERR_CERT_AUTHORITY_INVALID).
View certificate
```
Looks like this can be fixed during the generation process: [Invalid self signed SSL cert - “Subject Alternative Name Missing”](https://stackoverflow.com/questions/43665243/invalid-self-signed-ssl-cert-subject-alternative-name-missing). That link contains some potential workarounds and much more detailed information that I have in my brain.
Since this is happening out-of-the "box" (installation repos) with current browser versions, it would be nice to see a bugfix be entered for it. If it indeed is an issue with the self-signed autogenerated certificate and it's using improper cypher or something, that should be readily fixable with a small commit. It could be quite discouraging for new users to try to fire up a test instance and not be able to get it to work.
Update: Final note/nod to reporter and other posters, I am not sure if it is the browser or the application server redirecting to HTTP/80, but the reason it's causing an issue for us is the same. We have an external firewall running, and we keep the idp boxes in the DMZ for security purposes. So they have only bare-minimum ports open to the LAN and to the WAN. Since SAML is naked and insecure with SSL, HTTPS/80 is not open so that's why it seems like the fresh install is broken.
I do think this could be an easy fix if setup.py's certificate generation commands added in a subject alternative field. Here's a link specific to that: [enter link description here](https://stackoverflow.com/questions/7580508/getting-chrome-to-accept-self-signed-localhost-certificate/43666288#43666288), but it's specific to Linux and OpenSSL. I am assuming this is happening with Java keytool so here's an example of that: [Java Keytool Chrome/Firefox friendly self-signed cert method w/subjectaltname](https://serverfault.com/questions/605843/unable-to-generate-certificate-with-subject-alternate-name-using-java-1-7-keytoo)