ERR_SSL_PROTOCOL_ERROR – Troubleshooting After Enabling HTTP2

apache-2.4http2ssl

I'm setting HTTP2 for my application and I get randomly ERR_SSL_PROTOCOL_ERROR on y browser.

this is happening only on Google Chrome browser. Everything is OK on Firefox.

I'm using Let's Encrypth to encrypt with SSL and everything was working well. The problem occured after I have enabled HTTP2 today. I'm using Apache2. I updated it to 2.4.38 to support HTTP2 module

I tried the following :

  • disabling http2 module / restarting apache2

  • clearing all the browser cache

  • resetting the HSTS header using .htacess :

Header set Strict-Transport-Security "max-age=0; includeSubDomains;" env=HTTPS

No results, this is still have randomly the error.

here is my vhost config :

<IfModule mod_ssl.c>
    <VirtualHost *:443>
            DocumentRoot /var/www/domain/prod/web
            ServerName sub.domain.tld
            ServerAlias domain
            ServerAdmin admin@domain.tld

    <Directory "/var/www/domain/prod/web/">
            Options FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            Allow from All
    </Directory>
    ErrorLog /var/www/domain/prod/logs/error.log
    LogLevel warn
    CustomLog /var/www/domain/prod/logs/access.log combined
    ServerSignature On

            SSLEngine On
            Include /etc/letsencrypt/options-ssl-apache.conf

            Protocols h2 http/1.1

            SSLCertificateFile 
            /etc/letsencrypt/live/domain/fullchain.pem
            SSLCertificateKeyFile 
           /etc/letsencrypt/live/domain/privkey.pem
    </VirtualHost>
 </IfModule>

last update

I've market Martin's answer as best answer because installing PHP-FPM seems to have solved my problem (don't see the SSL_ERROR)
what i did: https://www.vultr.com/docs/use-php5-fpm-with-apache-2-on-ubuntu-14-04

but for one of my websites, I get a 500 error for a specific page. le apache error logs says :

[Mon Apr 01 14:58:31.844703 2019] [:error] [pid 30434] [client 81.200.189.9:30902] FastCGI: server "/usr/lib/cgi-bin/php5-fcgi" stderr: PHP message: PHP  12. Project->projectFormat() /var/www/jachete/models/Project.php:137

I don't really understand what's the error is about, any idea ?

update

interesting things happens here after disabling "pagespeed" module, here the errors I get from error.log

[Sun Mar 31 16:13:07.090348 2019] [http2:warn] [pid 16845] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Sun Mar 31 16:13:07.119247 2019] [mpm_prefork:notice] [pid 16845] AH00163: Apache/2.4.38 (Ubuntu) OpenSSL/1.1.1b mpm-itk/2.4.6-01 PHP/5.5.9-1ubuntu4.27 configured -- resuming normal operations

according to https://http2.pro/doc/Apache this is due to mpm-itk not supproting http2. as it's just notices/warnings I think there is no reason to cause SSL_ERROR ?

here is the test results of Qualys Lab (A)Qualys : https://imgur.com/rEfhopw

here are some apache2 error logs :

    [Sun Mar 31 15:31:07.393421 2019] [pagespeed:error] [pid 13785] [mod_pagespeed 1.13.35.2-0 @13785] Failed to make directory /var/cache/mod_pagespeed/v3/domain.tld/https,3A/,2Fapp.domain.tld: Permission denied
[Sun Mar 31 15:31:07.393454 2019] [pagespeed:error] [pid 13785] [mod_pagespeed 1.13.35.2-0 @13785] Could not create directories for file /var/cache/mod_pagespeed/v3/domain.tld/https,3A/,2Fapp.domain.tld/views/assets/img/loading.gif,.temp
[Sun Mar 31 15:31:07.393488 2019] [pagespeed:error] [pid 13785] [mod_pagespeed 1.13.35.2-0 @13785] /var/cache/mod_pagespeed/v3/domain.tld/https,3A/,2Fapp.domain.tld/views/assets/img/loading.gif,.tempqeySBV:0: opening temp file: No such file or directory
[Sun Mar 31 15:31:08.115111 2019] [pagespeed:error] [pid 13785] [mod_pagespeed 1.13.35.2-0 @13785] Failed to make directory /var/cache/mod_pagespeed/v3/domain.tld/https,3A/,2Fapp.domain.tld: Permission denied
[Sun Mar 31 15:31:08.115142 2019] [pagespeed:error] [pid 13785] [mod_pagespeed 1.13.35.2-0 @13785] Could not create directories for file /var/cache/mod_pagespeed/v3/domain.tld/https,3A/,2Fapp.domain.tld/views/assets/img/logo/favicon.png,.temp
[Sun Mar 31 15:31:08.115162 2019] [pagespeed:error] [pid 13785] [mod_pagespeed 1.13.35.2-0 @13785] /var/cache/mod_pagespeed/v3/domain.tld/https,3A/,2Fapp.domain.tld/views/assets/img/logo/favicon.png,.tempT2JwQU:0: opening temp file: No such file or directory
[Sun Mar 31 15:31:08.118059 2019] [pagespeed:error] [pid 13785] [mod_pagespeed 1.13.35.2-0 @13785] Failed to make directory /var/cache/mod_pagespeed/v3/domain.tld/https,3A/,2Fapp.domain.tld: Permission denied
[Sun Mar 31 15:31:08.118103 2019] [pagespeed:error] [pid 13785] [mod_pagespeed 1.13.35.2-0 @13785] Could not create directories for file /var/cache/mod_pagespeed/v3/domain.tld/https,3A/,2Fapp.domain.tld/views/assets/img/logo/xfavicon.png.pagespeed.ic.coNvSghNBK.webp,.temp
[Sun Mar 31 15:31:08.118126 2019] [pagespeed:error] [pid 13785] [mod_pagespeed 1.13.35.2-0 @13785] /var/cache/mod_pagespeed/v3/domain.tld/https,3A/,2Fapp.domain.tld/views/assets/img/logo/xfavicon.png.pagespeed.ic.coNvSghNBK.webp,.tempg9bR5T:0: opening temp file: No such file or directory

there is a permission denied error, but when I look to permissions, I get this

drwxr-xr-x  6 www-data www-data 4096 Oct 30 06:34 http,3A/
drwxr-xr-x  3 www-data www-data 4096 Jun 30  2018 https,3A/

should I add write permission for all users ? (chmod a+w dir/ -R) ?

By the way, the SSL error still occure, even when I disable the PageSpeed module, so i guess the errors in log above aren't related to my SSL problem ?

Best Answer

Disable mpm_prefork, don't use mod_php use PHP FPM as a fast CGI proxy and all will be well.

See: https://http2.pro/doc/Apache

I hope that helps.