Description
Since upgrading to Apache 2.4.18 node is unable to get https requests, though I can see the request in the log files and it is returning a 200 status.
I have the following protocols set:
Protocols h2 http/1.1
Turning off h2 in the protocols, or rolling back to 2.4.17 resolves the issue. Node currently makes a http/1.1 request so looks like some incompatibility. Not sure if node is at fault here or Apache but as it used to work in 2.4.17 with same protocol settings.
I wonder if this change might caused the issue?:
*) core: if the first HTTP/1.1 request on a connection goes to a server that
prefers different protocols, these protocols are announced in a Upgrade:
header on the response, mentioning the preferred protocols.
I also tried reversing the Protocols config:
Protocols http/1.1 h2
This worked for Node but stopped http/2 working in Chrome and Opera (even if ProtocolsHonorOrder is set to off - though that seems to work for Firefox and Edge).
I've not seen any other issues with any other clients (browsers, scripts or online tools) except Node ones.
To repeat install Node, add an example script with code like below to call my site (www.tunetheweb.com):
var https = require('https');
var options = {
hostname: 'www.tunetheweb.com',
path: '/',
};
var req = https.request(options, function(res) {
console.log("statusCode: ", res.statusCode);
console.log("headers: ", res.headers);
res.on('data', function(d) {
process.stdout.write(d);
});
});
req.end();
req.on('error', function(e) {
console.log(e);
});
in a file called example.js and run it with the following command:
node example.js
When h2 is enabled in apache 2.4.18 nothing will be returned, but the request is logged in the apache log with a 200 status.
When h2 is enabled in apache 2.4.17 (or h2 is disabled in apache 2.4.18) the page is returned.
Alternatively sign up to a uptimerobot.com account (which uses node to test your website responds) which is where I first noticed this :-)
Let me know if there is anything more I can do to help debug or resolve.
Thanks,
Barry