From c69fbe6bf9333d3f0081f5ac0e7f0e458831c469 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Wed, 23 Oct 2024 19:50:37 +0200 Subject: [PATCH] tls: allow to configure all supported TLS versions and ciphers Signed-off-by: Nicola Murino --- internal/util/util.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/util/util.go b/internal/util/util.go index 30d0bd09..b9677a70 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -646,6 +646,11 @@ func GetTLSCiphersFromNames(cipherNames []string) []uint16 { ciphers = append(ciphers, c.ID) } } + for _, c := range tls.InsecureCipherSuites() { + if c.Name == strings.TrimSpace(name) { + ciphers = append(ciphers, c.ID) + } + } } if len(ciphers) == 0 { @@ -807,7 +812,9 @@ func GetRedactedURL(rawurl string) string { return u.Redacted() } -// GetTLSVersion returns the TLS version for integer: +// GetTLSVersion returns the TLS version from an integer value: +// - 10 means TLS 1.0 +// - 11 means TLS 1.1 // - 12 means TLS 1.2 // - 13 means TLS 1.3 // default is TLS 1.2 @@ -815,6 +822,10 @@ func GetTLSVersion(val int) uint16 { switch val { case 13: return tls.VersionTLS13 + case 11: + return tls.VersionTLS11 + case 10: + return tls.VersionTLS10 default: return tls.VersionTLS12 }