user9119021
user9119021

Reputation:

This site can’t provide a secure connection - How to fix?

I think I've set up HTTPS on my server (Apache 2.4 on Windows 10)

It was working for a while, but I accidentally deleted my httpd.conf and some other files and after replacing them with old backups, now when I navigate to my domain it says "This site can’t provide a secure connection - domain.com sent an invalid response."

When I type in console "php -i", I get these relevant lines:

PHP Version => 7.1.11

Registered Stream Socket Transports => tcp, udp, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2

core SSL => supported

OpenSSL support => enabled

openssl.cafile => c:\php\cacert.pem => c:\php\cacert.pem

I'm not really sure that I am even using openssl, I don't know what the different versions of SSL are.

But in my httpd.conf:

LoadModule ssl_module modules/mod_ssl.so
#Listen 80
Listen 443

and my httpd-ssl.conf:

Listen 443
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLHonorCipherOrder on
SSLProtocol all -SSLv3
SSLProxyProtocol all -SSLv3
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:c:/Apache24/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
<VirtualHost _default_:443>
ServerName domain.com:443
ServerAlias www.domain.com
DocumentRoot "c:/Apache24/htdocs/public"
SSLEngine on
SSLCertificateFile "c:/Apache24/conf/domain.crt"
SSLCertificateKeyFile "c:/Apache24/conf/domain.key"
SSLCertificateChainFile "c:/Apache24/conf/intermediate.pem"
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
SSLHonorCipherOrder on
<Directory "c:/Apache24/htdocs/public">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All  
    Order allow,deny
    allow from all
</Directory>

But I have no idea whether httpd-ssl.conf is even being included or used at all. Do I have to include it from httpd.conf file? How do I do that? I tried this:

Include conf/extra/httpd-ssl.conf

But then Apache won't start

Upvotes: 0

Views: 10249

Answers (1)

user9119021
user9119021

Reputation:

I fixed it!

I found out that these 4 modules are needed for SSL (HTTPS) in Apache 2.4:

LoadModule setenvif_module modules/mod_setenvif.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

I deleted my httpd.conf by accident which caused the problem.

The first 2 lines above are in the default httpd.conf, the 3rd line I remembered to add, but I didn't know I needed the 4th line (I still don't even know what it is).

So I added this to my httpd.conf:

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

I also needed to add this line for my setup, because I'm using httpd-ssl.conf:

Include conf/extra/httpd-ssl.conf

I still have some other problems that I need to fix, but I'm moving forward.

Upvotes: 2

Related Questions