Skip to content

Commit

Permalink
Introduce tlscommon.SetInsecureDefaults (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-laterman authored Dec 13, 2024
1 parent 0d51b5b commit 4486532
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions transport/tlscommon/versions_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const (
TLSVersion11 TLSVersion = tls.VersionTLS11
TLSVersion12 TLSVersion = tls.VersionTLS12
TLSVersion13 TLSVersion = tls.VersionTLS13
)

var (
// TLSVersionMin is the min TLS version supported.
TLSVersionMin = TLSVersion10

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

// SetInsecureDefaults is currently a nop as the default versions have not changed.
//
// This function is used to avoid a breaking change on previous releases.
// We plan on the default minimum versions list to exclude TLS1.1, and not allow TLS1.0 in a future library update.
func SetInsecureDefaults() {
TLSVersionMin = TLSVersion10
TLSVersionDefaultMin = TLSVersion11
TLSDefaultVersions = []TLSVersion{
TLSVersion11,
TLSVersion12,
TLSVersion13,
}
}

// Intended for ECS's tls.version_protocol_field, which does not include
// numeric version and should be lower case
type TLSVersionDetails struct {
Expand Down

0 comments on commit 4486532

Please sign in to comment.