redbird
redbird copied to clipboard
SSL Doesn't Work with Node 11
I upgraded my server's Node 10 to 11 and started getting these errors while being completely unable to connect.
7|server | le.challenges[tls-sni-01].loopback should be defined as function (opts, domain, token, keyAuthorization, cb) { ... } and should prove (by external means) that the ACME server challenge 'tls-sni-01' will succeed
7|server | RangeError: Invalid typed array length: -4095
7|server | at new Uint8Array (<anonymous>)
7|server | at new FastBuffer (buffer.js:72:1)
7|server | at Handle.onStreamRead [as onread] (internal/stream_base_commons.js:144:17)
7|server | at Stream.<anonymous> (/srv/www/server/node_modules/handle-thing/lib/handle.js:88:10)
7|server | at Stream.emit (events.js:194:15)
7|server | at endReadableNT (/srv/www/server/node_modules/spdy-transport/node_modules/readable-stream/lib/_stream_readable.js:1038:12)
7|server | at args.(anonymous function) (/usr/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:138:29)
7|server | at process.internalTickCallback (internal/process/next_tick.js:72:19)
The first line is repeated multiple times and sometimes it would crash on RangeError
.
server.js:
const path = require('path');
const proxy = require('redbird')({
port: 80,
letsencrypt: {
path: path.join(__dirname, '/certs')
},
ssl: {
http2: true,
port: 443
}
});
const sslSettings = {
letsencrypt: {
email: '[email protected]',
production: true
}
}
proxy.register('dacio.app', 'http://localhost:8080', {
ssl: sslSettings
});
proxy.register('www.dacio.app', 'http://localhost:8080', {
ssl: sslSettings
});
proxy.register('giphy.dacio.app', 'http://localhost:8081', {
ssl: sslSettings
});
proxy.register('potatoes.dacio.app', 'http://localhost:8082', {
ssl: sslSettings
});
proxy.register('teamlink.dacio.app', 'http://localhost:8083', {
ssl: sslSettings
});
proxy.register('markov.dacio.app', 'http://localhost:8084', {
ssl: sslSettings
});
proxy.register('unreddit.dacio.app', 'http://localhost:8085', {
ssl: sslSettings
});
proxy.register('cohesion.dacio.app', 'http://localhost:8086', {
ssl: sslSettings
});
+1
any solution?
I get the same error
My error is slightly different - the proxy starts fine, but then throws an exception (in Node 11.8 - works fine in Node 10.15) when the first path is hit.
My proxy code:
var fs = require('fs-extra')
var proxyOptions = {
port: 80,
ssl: {
port: 443,
key: 'certs/mylocaldomain-key.pem',
cert: 'certs/mylocaldomain-cert.pem',
http2: true
}
}
var proxy = require('redbird')(proxyOptions);
proxy.register("mylocaldomain.com", "http://localhost:3000/", { ssl: true });
// start the proxy server on the port specified above
function startServer(port){
// just http for now, https in the future
var http = require('http');
function handleRequest(request, response){
response.end('Path Hit: ' + request.url);
}
// run the server
var server = http.createServer(handleRequest);
server.listen(port, function(){
console.log("Server listening on: http://localhost:%s", port);
});
}
This starts fine. But when I hit a path - this error gets thrown, which is similar to the error mentioned by @DacioRomero above, but appears to be at a different place in the redbird
code:
internal/buffer.js:788
class FastBuffer extends Uint8Array {}
^
RangeError: Invalid typed array length: -4095
at new Uint8Array (<anonymous>)
at new FastBuffer (internal/buffer.js:788:1)
at Handle.onStreamRead [as onread] (internal/stream_base_commons.js:144:17)
at Stream.<anonymous> (C:\Users\gtw\Documents\GitHub\severedlinks-react-app\node_modules\handle-thing\lib\handle.js:88:10)
at Stream.emit (events.js:202:15)
at endReadableNT (C:\Users\gtw\Documents\GitHub\severedlinks-react-app\node_modules\spdy-transport\node_modules\readable-stream\lib\_stream_readable.js:1047:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
+1 Turning off HTTP/2 fixes it but I don't want to use HTTP/1.1
With NodeJS 12 I get the same error when HTTP2 is turned on.
Any clues how to fix it or is anyone working on fix?
RangeError: Invalid typed array length: -4095 at new Uint8Array (<anonymous>) at new FastBuffer (internal/buffer.js:941:1) at Handle.onStreamRead [as onread] (internal/stream_base_commons.js:165:17) at Stream.<anonymous> (/node_modules/handle-thing/lib/handle.js:88:10) at Stream.emit (events.js:201:15) at endReadableNT (/node_modules/spdy-transport/node_modules/readable-stream/lib/_stream_readable.js:1077:12) at processTicksAndRejections (internal/process/task_queues.js:84:9)
@mrkmrtns I've had to keep using nvm to rollback to node 10 in development. No idea how to fix this. I get the same error on every version of node above 10.
so there may be some breaking change in node 12 that breaks Redbird, I will take a look into it when I have some spare time, since the workaround is to use the current LTS version 10.
This issue is still present with node 13.6.0. I really want to start using HTTP2, can this get fixed?
current LTS version 10
Node 12 is now in LTS. I have no problem using Node 10, but I can't test this as easily anymore now that I am using Docker and Traefik for my projects.
Also stumbled upon this when I upgraded to 12. Is there really no way to fix it (other than http2 = false)?
This issue is still present with node 14. I really want to start using HTTP2, can this get fixed?
I get the same error @manast ... please