Skip to content

Commit

Permalink
crypto/tls: remove tls10default GODEBUG flag
Browse files Browse the repository at this point in the history
Updates #45428

Change-Id: Ic2ff459e6a3f1e8ded2a770c11d34067c0b39a8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/400974
Reviewed-by: Filippo Valsorda <[email protected]>
Auto-Submit: Filippo Valsorda <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Filippo Valsorda <[email protected]>
Reviewed-by: Roland Shoemaker <[email protected]>
  • Loading branch information
FiloSottile authored and gopherbot committed Apr 27, 2022
1 parent 0b5218c commit f0ee7fd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
10 changes: 10 additions & 0 deletions doc/go1.19.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
TODO: complete this section
</p>

<dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
<dd>
<p><!-- CL 400974 -->
The <code>tls10default</code> <code>GODEBUG</code> option has been
removed. It is still possible to enable TLS 1.0 client-side by setting
<code>Config.MinVersion</code>.
</p>
</dd>
</dl><!-- crypto/tls -->

<dl id="image/draw"><dt><a href="/pkg/image/draw/">image/draw</a></dt>
<dd>
<p><!-- CL 396795 -->
Expand Down
6 changes: 1 addition & 5 deletions src/crypto/tls/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"crypto/x509"
"errors"
"fmt"
"internal/godebug"
"io"
"net"
"strings"
Expand Down Expand Up @@ -974,9 +973,6 @@ var supportedVersions = []uint16{
VersionTLS10,
}

// debugEnableTLS10 enables TLS 1.0. See issue 45428.
var debugEnableTLS10 = godebug.Get("tls10default") == "1"

// roleClient and roleServer are meant to call supportedVersions and parents
// with more readability at the callsite.
const roleClient = true
Expand All @@ -985,7 +981,7 @@ const roleServer = false
func (c *Config) supportedVersions(isClient bool) []uint16 {
versions := make([]uint16, 0, len(supportedVersions))
for _, v := range supportedVersions {
if (c == nil || c.MinVersion == 0) && !debugEnableTLS10 &&
if (c == nil || c.MinVersion == 0) &&
isClient && v < VersionTLS12 {
continue
}
Expand Down
10 changes: 0 additions & 10 deletions src/crypto/tls/handshake_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,16 +400,6 @@ func TestVersion(t *testing.T) {
if err == nil {
t.Fatalf("expected failure to connect with TLS 1.0/1.1")
}

defer func(old bool) { debugEnableTLS10 = old }(debugEnableTLS10)
debugEnableTLS10 = true
_, _, err = testHandshake(t, clientConfig, serverConfig)
if err != nil {
t.Fatalf("handshake failed: %s", err)
}
if state.Version != VersionTLS11 {
t.Fatalf("incorrect version %x, should be %x", state.Version, VersionTLS11)
}
}

func TestCipherSuitePreference(t *testing.T) {
Expand Down

0 comments on commit f0ee7fd

Please sign in to comment.