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.createSecureServer - No warnings if no cert/key provided in options #14668

Closed
ghost opened this issue Aug 7, 2017 · 2 comments
Closed
Labels
http2 Issues or PRs related to the http2 subsystem.

Comments

@ghost
Copy link

ghost commented Aug 7, 2017

  • Version: v9.0.0-pre
  • Platform: Linux linuxbox 4.10.0-30-generic fix LICENSE #34~16.04.1-Ubuntu SMP Wed Aug 2 02:13:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • **Subsystem: http2
// Server
const http2 = require('http2');
const hostname = '127.0.0.1';
const port = 3000;

// Create a plain-text HTTP/2 server
const server = http2.createSecureServer();

server.on('stream', (stream, headers) => {
    // stream is a Duplex
    stream.respond({
        'content-type': 'text/html',
        ':status': 200
    });
    stream.end('<h1>Hello World</h1>');
});

server.listen(port, hostname, () => {
    console.log(`Server running at https://${hostname}:${port}/`);
});

./node --expose-http2 http2server.js (node:21866) ExperimentalWarning: The http2 module is an experimental API. Server running at https://127.0.0.1:3000/

https://127.0.0.1:3000/ is unreachable and no warnings in terminal

Note: this behavior is the same with https module

@mscdex mscdex added the http2 Issues or PRs related to the http2 subsystem. label Aug 7, 2017
@mscdex
Copy link
Contributor

mscdex commented Aug 7, 2017

TLS is technically optional for HTTP2, although most browsers for example only implement HTTP2 with TLS.

As far as https not requiring a key and certificate goes, see this issue.

@jasnell
Copy link
Member

jasnell commented Aug 7, 2017

This issue is not specific to http/2 in any way and there is already an existing issue that deals with this. Going to go ahead and close this one.

@jasnell jasnell closed this as completed Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants