By tinotk
I’m using Cloudflare DNS w/ Full SSL. The SSL certificates was installed using certbot as showed in this guide:
https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-16-04
But when trying to access my website under https using Chrome:
This site can’t provide a secure connection
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR
I’ve checked the ufw port 443 are allowed. In <VirtualHost *:443> the path to SSLCertificateFile and SSLCertificateKeyFile point to correct key created by certbot.
Please advise what might be the problem in this case?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This error likely points to a mis-configuration somewhere in your Apache setup. If you can share your apache configuration for the ssl and non-ssl versions of your site I’d be happy to take a closer look. My first guess would be that Apache is trying to send an http response on port 443 instead of the https one but without more information it is difficult to know for sure.
You may also find more information by using an SSL testing tool like this or a command line web client where you can enable verbose output during the connection request.
This is how my virtualhost setup
<VirtualHost *:80>
ServerAdmin info@domainA.com
ServerName domainA.com
ServerAlias www.domainA.com
DocumentRoot /var/www/html/domainA.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/domainA.com>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin info@domainA.com
ServerName domainA.com
ServerAlias www.domainA.com
DocumentRoot /var/www/html/domainA.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/domainA.com>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/domainA.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domainA.com-0001/privkey.pem
</VirtualHost>
<VirtualHost *:80>
ServerAdmin info@domainA.com
ServerName sub.domainA.com
DocumentRoot /var/www/html/sub1
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/sub1>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin info@domainA.com
ServerName sub.domainA.com
DocumentRoot /var/www/html/sub1
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/sub1>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domainA.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domainA.com-0001/privkey.pem
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.