Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http2 module -> Chrome ERR_SSL_VERSION_OR_CIPHER_MISMATCH error #2761

Open
meriturva opened this issue Jul 4, 2017 · 6 comments
Open

Http2 module -> Chrome ERR_SSL_VERSION_OR_CIPHER_MISMATCH error #2761

meriturva opened this issue Jul 4, 2017 · 6 comments

Comments

@meriturva
Copy link

meriturva commented Jul 4, 2017

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?

@meriturva
Copy link
Author

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?

@vekexasia
Copy link

vekexasia commented Mar 9, 2018

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?

@meriturva
Copy link
Author

No! No solution found. I just keep http protocol for my tests and no speed up using http2

@jfstephe
Copy link

jfstephe commented Jan 8, 2020

(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 :-(

@martonx
Copy link

martonx commented Dec 8, 2020

Karma is unable to run Chrome with HTTPS. It is a big problem as I want to test browser APIs working only with HTTPS.

@johnjbarton
Copy link
Contributor

@martonx Running karma on https is not related to http2 module use. Look into the config option httpsServerOptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants