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

[v11.x backport] TLS1.3 #26951

Closed
wants to merge 13 commits into from
Closed

Commits on Apr 11, 2019

  1. tls: add code for ERR_TLS_INVALID_PROTOCOL_METHOD

    Add an error code property to invalid `secureProtocol` method
    exceptions.
    
    PR-URL: nodejs#24729
    Reviewed-By: Joyee Cheung <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    742c920 View commit details
    Browse the repository at this point in the history
  2. tls: revert change to invalid protocol error type

    In nodejs#24729, the error was changed to
    be a TypeError, which is the standard type for this kind of error.
    However, it was Error in 11.x and earlier, so revert that single aspect,
    so the backport can be semver-minor.
    sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    dc1c40b View commit details
    Browse the repository at this point in the history
  3. src: add .code and SSL specific error properties

    SSL errors have a long structured message, but lacked the standard .code
    property which can be used for stable comparisons. Add a `code`
    property, as well as the 3 string components of an SSL error: `reason`,
    `library`, and `function`.
    
    PR-URL: nodejs#25093
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Daniel Bevenius <[email protected]>
    sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    69d53f6 View commit details
    Browse the repository at this point in the history
  4. deps: upgrade openssl sources to 1.1.1b

    This updates all sources in deps/openssl/openssl with openssl-1.1.1b.
    
    PR-URL: nodejs#26327
    Reviewed-By: Gireesh Punathil <[email protected]>
    Reviewed-By: Michael Dawson <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    5f12a8a View commit details
    Browse the repository at this point in the history
  5. deps: add s390 asm rules for OpenSSL-1.1.1

    This is a floating patch against OpenSSL-1.1.1 to generate asm files
    with Makefile rules.
    
    PR-URL: nodejs#26327
    Reviewed-By: Gireesh Punathil <[email protected]>
    Reviewed-By: Michael Dawson <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    
    Original:
    
    Fixes: nodejs#4270
    PR-URL: nodejs#19794
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Rod Vagg <[email protected]>
    Reviewed-By: Michael Dawson <[email protected]>
    shigeki authored and sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    7b132ba View commit details
    Browse the repository at this point in the history
  6. deps: update archs files for OpenSSL-1.1.1b

    `cd deps/openssl/config; make` updates all archs dependant files.
    
    PR-URL: nodejs#26327
    Reviewed-By: Gireesh Punathil <[email protected]>
    Reviewed-By: Michael Dawson <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    9ac83c7 View commit details
    Browse the repository at this point in the history
  7. tls: support TLSv1.3

    This introduces TLS1.3 support and makes it the default max protocol,
    but also supports CLI/NODE_OPTIONS switches to disable it if necessary.
    
    TLS1.3 is a major update to the TLS protocol, with many security
    enhancements. It should be preferred over TLS1.2 whenever possible.
    
    TLS1.3 is different enough that even though the OpenSSL APIs are
    technically API/ABI compatible, that when TLS1.3 is negotiated, the
    timing of protocol records and of callbacks broke assumptions hard-coded
    into the 'tls' module.
    
    This change introduces no API incompatibilities when TLS1.2 is
    negotiated. It is the intention that it be backported to current and LTS
    release lines with the default maximum TLS protocol reset to 'TLSv1.2'.
    This will allow users of those lines to explicitly enable TLS1.3 if they
    want.
    
    API incompatibilities between TLS1.2 and TLS1.3 are:
    
    - Renegotiation is not supported by TLS1.3 protocol, attempts to call
    `.renegotiate()` will always fail.
    
    - Compiling against a system OpenSSL lower than 1.1.1 is no longer
    supported (OpenSSL-1.1.0 used to be supported with configure flags).
    
    - Variations of `conn.write('data'); conn.destroy()` have undefined
    behaviour according to the streams API. They may or may not send the
    'data', and may or may not cause a ERR_STREAM_DESTROYED error to be
    emitted. This has always been true, but conditions under which the write
    suceeds is slightly but observably different when TLS1.3 is negotiated
    vs when TLS1.2 or below is negotiated.
    
    - If TLS1.3 is negotiated, and a server calls `conn.end()` in its
    'secureConnection' listener without any data being written, the client
    will not receive session tickets (no 'session' events will be emitted,
    and `conn.getSession()` will never return a resumable session).
    
    - The return value of `conn.getSession()` API may not return a resumable
    session if called right after the handshake. The effect will be that
    clients using the legacy `getSession()` API will resume sessions if
    TLS1.2 is negotiated, but will do full handshakes if TLS1.3 is
    negotiated.  See nodejs#25831 for more
    information.
    
    PR-URL: nodejs#26209
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Rod Vagg <[email protected]>
    sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    921a040 View commit details
    Browse the repository at this point in the history
  8. tls: revert default max to TLSv1.2

    TLSv1.3 is still supported when explicitly configured, but it is not the
    default.
    sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    06dd4b2 View commit details
    Browse the repository at this point in the history
  9. tls: add CHECK for impossible condition

    PR-URL: nodejs#26843
    Reviewed-By: Sam Roberts <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Minwoo Jung <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    addaleax authored and sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    fc0fc8a View commit details
    Browse the repository at this point in the history
  10. tls: add debugging to native TLS code

    PR-URL: nodejs#26843
    Reviewed-By: Sam Roberts <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Minwoo Jung <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    addaleax authored and sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    2aaffb6 View commit details
    Browse the repository at this point in the history
  11. doc: describe tls.DEFAULT_MIN_VERSION/_MAX_VERSION

    PR-URL: nodejs#26821
    Reviewed-By: Ben Noordhuis <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    6589fe1 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    3462f8a View commit details
    Browse the repository at this point in the history
  13. tls: add --tls-min-v1.2 CLI switch

    For 11.x, the default minimum is TLSv1, so it needs a CLI switch to
    change the default to the more secure minimum of TLSv1.2.
    sam-github committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    011574f View commit details
    Browse the repository at this point in the history