Skip to content

http2.createSecureServer - No warnings if no cert/key provided in options #14668

Description

  • 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

Activity

  1. added
    http2Issues and PRs related to the http2 subsystem.
    on Aug 7, 2017
  2. mscdex commented on Aug 7, 2017

    @mscdex
    Contributor

    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.

  3. jasnell commented on Aug 7, 2017

    @jasnell
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    http2Issues and PRs related to the http2 subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions