karma
karma copied to clipboard
Http2 module -> Chrome ERR_SSL_VERSION_OR_CIPHER_MISMATCH error
Expected behaviour
Correct use of servermodule: https://github.com/nodejs/http2
Actual behaviour
No way
Environment Details
- Karma version: 1.7
- Windows 10
Steps to reproduce the behaviour
We have generated correctly self-signed certificated and we also tested with simple app:
'use strict';
let http2 = require('http2'),
fs = require('fs');
let options = {
passphrase: 'xxxx',
key: fs.readFileSync(__dirname + '/server.key'),
cert: fs.readFileSync(__dirname + '/server.crt')
};
http2.createServer(options, function(req, res) {
res.writeHead(200);
res.end('Hello world over HTTP/2');
}).listen(3000);
Simple app works but when we use it with karma:
config.set({
httpModule: require('http2'),
protocol: 'https:',
httpsServerOptions: {
passphrase: 'xxxx',
key: fse.readFileSync(path.join(__dirname, '/server.key')),
cert: fse.readFileSync(path.join(__dirname, '/server.crt'))
},
Chrome browser just return error: ERR_SSL_VERSION_OR_CIPHER_MISMATCH
karma no error on console.
I think that karma doesn't work correctly with http2 module (https://github.com/nodejs/http2).
Am i right? any solution?
I'm really sorry to write again here but we are blocked and we cannot pass to http2 protocol due to that issue. Any advice or workaround here?
Hello @meriturva ,
It looks we're on the same boat. Furthermore i can't make it work even with http1. Getting the very same issue of yours: ERR_SSL_VERSION_OR_CIPHER_MISMATCH.
Did you, by any chance, found a solution?
No! No solution found. I just keep http protocol for my tests and no speed up using http2
(caveat - it's late and this is doing my head in)
I didn't get this exact error but versions of node etc have moved on, but basically I too can't get http2 working, despite getting a 'test' server working as above.
I think createSecureServer should be being called in the karam web-server.js file but isn't. You can hack it by doing this in your karma config file though:
const http2 = require('http2'); http2.createServer = http2.createSecureServer;
Still doesn't work for me though, because of the proxy and not being able to translate between http1 and http2 header formats, so perhaps that too needs upgrading to http2-proxy.
It's a bit annoying as I've wasted probably 6-8 hours on this, assuming that it should be possible. The docs lead you to believe it but there's no working examples that I could find anywhere. Serving of the files is too slow and I may need to completely re-think my application testing strategy because of this :-(
Karma is unable to run Chrome with HTTPS. It is a big problem as I want to test browser APIs working only with HTTPS.
@martonx Running karma on https is not related to http2 module use. Look into the config option httpsServerOptions