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

[v12.x] tls: reset secureConnecting on client socket #34859

Closed
wants to merge 2 commits into from

Commits on Sep 25, 2020

  1. tls: reset secureConnecting on client socket

    secureConnecting is never set to false on client TLS sockets.
    So if Http2Session constructor (in lib/internal/http2/core.js) is
    called after secureConnect is emitted, then it will wrongly wait
    for a secureConnect event.
    
    This fix sets secureConnecting to false when a client TLS socket
    has connected.
    
    PR-URL: nodejs#33209
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
    davedoesdev authored and addaleax committed Sep 25, 2020
    Configuration menu
    Copy the full SHA
    6ff8562 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2020

  1. test: add ALPNProtocols option to clientOptions

    Without this, the session is destroyed with the following error
    
    ```
    Error [ERR_HTTP2_ERROR]: Protocol error
        at Http2Session.onSessionInternalError (internal/http2/core.js:756:26)
    Emitted 'error' event on ClientHttp2Session instance at:
        at emitClose (internal/http2/core.js:1010:10)
        at internal/http2/core.js:1048:7
        at finish (internal/streams/writable.js:731:5)
        at processTicksAndRejections (internal/process/task_queues.js:80:21) {
      code: 'ERR_HTTP2_ERROR',
      errno: -505
    }
    ```
    
    The test then calls `session.close()` which tries to write to a
    destroyed socket. As a result, an unhandled `ECONNRESET` error is
    emitted in the v12 release line.
    
    PR-URL: nodejs#35482
    Refs: nodejs#34859
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    lpinca committed Oct 9, 2020
    Configuration menu
    Copy the full SHA
    e221cbe View commit details
    Browse the repository at this point in the history