• Filippo Valsorda's avatar
    crypto/tls: implement TLS 1.3 version negotiation · 7f5dce08
    Filippo Valsorda authored
    RFC 8446 recommends using the supported_versions extension to negotiate
    lower versions as well, so begin by implementing it to negotiate the
    currently supported versions.
    
    Note that pickTLSVersion was incorrectly negotiating the ServerHello
    version down on the client. If the server had illegally sent a version
    higher than the ClientHello version, the client would have just
    downgraded it, hopefully failing later in the handshake.
    
    In TestGetConfigForClient, we were hitting the record version check
    because the server would select TLS 1.1, the handshake would fail on the
    client which required TLS 1.2, which would then send a TLS 1.0 record
    header on its fatal alert (not having negotiated a version), while the
    server would expect a TLS 1.1 header at that point. Now, the client gets
    to communicate the minimum version through the extension and the
    handshake fails on the server.
    
    Updates #9671
    
    Change-Id: Ie33c7124c0c769f62e10baad51cbed745c424e5b
    Reviewed-on: https://go-review.googlesource.com/c/146217
    Run-TryBot: Filippo Valsorda <filippo@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAdam Langley <agl@golang.org>
    7f5dce08
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...