2

I have few sites which did not have SSL cert setup. The issue I am facing is, if these sites access using https it shows Unable to connect, Browser can't establish a connection to the server at mysite.com error

I think it should give a Your connection is not secure warning and give an option to go to the site

I cannot redirect https to http since there is no connection with the server

Done few searches but nothing shows up other than setting up https and troubleshooting.

I'm using ubuntu server with apache2 installed. It will be great if anyone can advice where to look/start. Thanks!

ASR
  • 1,801
  • 5
  • 25
  • 33

2 Answers2

9

Unable to connect, Browser can't establish a connection to the server at mysite.com

This error can be shown when either apache or virtual host itself cannot be reached over port 443.
You can check it with:

netstat -ntpl | grep apache2

In case apache does not losten on port 443 you should enable mod_ssl for apache:

a2enmod ssl

Restart apache and check that it listens on port 443 using netstat.
And finally make sure that at least self-signed certificate is configured.

In case you use apache virtual hosts and apache itself listens on port 443 then you need to configure virtual hosts to be accessible over port 443 (I suppose this is your case).
Modify the virtual host configuration file like below:

<IfModule mod_ssl.c>
   <VirtualHost xxx.xxx.xxx.xxx:443>
      ServerName "example.com:443"
      ...
      DocumentRoot ...
      ...
      SSLEngine on
      SSLVerifyClient none
      SSLCertificateFile /path/to/self-signed/certificate
      ...
   </VirtualHost>
</IfModule>

<VirtualHost xxx.xxx.xxx.xxx:80>
   ServerName "example.com:80"
   ...
</VirtualHost>
Elvis Plesky
  • 3,190
  • 1
  • 12
  • 21
0

You can redirect from https to http using the .htaccess file in apache2

Redirect https to http .htaccess

marlais
  • 11
  • 3
  • I know and I tried, but I couldn't redirect `https` to `http` since there is no connection with the server, So not sure where to start – ASR Aug 16 '17 at 02:18
  • Gotcha, so your request never reaches .htaccess because you don't have an SSL cert or 443 available for the initial HTTPS request? – marlais Aug 16 '17 at 02:22
  • Yes It didn't setup, Then I think It should give a `Your connection is not secure` warning right? My apache SSL is enabled. – ASR Aug 16 '17 at 02:25