Skip to content

Commit 4486532

Browse files
Introduce tlscommon.SetInsecureDefaults (#260)
1 parent 0d51b5b commit 4486532

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

transport/tlscommon/versions_default.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const (
2727
TLSVersion11 TLSVersion = tls.VersionTLS11
2828
TLSVersion12 TLSVersion = tls.VersionTLS12
2929
TLSVersion13 TLSVersion = tls.VersionTLS13
30+
)
3031

32+
var (
3133
// TLSVersionMin is the min TLS version supported.
3234
TLSVersionMin = TLSVersion10
3335

@@ -58,6 +60,20 @@ var tlsProtocolVersions = map[string]TLSVersion{
5860
"TLSv1.3": TLSVersion13,
5961
}
6062

63+
// SetInsecureDefaults is currently a nop as the default versions have not changed.
64+
//
65+
// This function is used to avoid a breaking change on previous releases.
66+
// We plan on the default minimum versions list to exclude TLS1.1, and not allow TLS1.0 in a future library update.
67+
func SetInsecureDefaults() {
68+
TLSVersionMin = TLSVersion10
69+
TLSVersionDefaultMin = TLSVersion11
70+
TLSDefaultVersions = []TLSVersion{
71+
TLSVersion11,
72+
TLSVersion12,
73+
TLSVersion13,
74+
}
75+
}
76+
6177
// Intended for ECS's tls.version_protocol_field, which does not include
6278
// numeric version and should be lower case
6379
type TLSVersionDetails struct {

0 commit comments

Comments
 (0)