Add deprecation warning

This commit is contained in:
Felix Niederwanger 2024-02-24 11:47:30 +01:00
parent 80401e4c98
commit 455811066b
Signed by: phoenix
GPG key ID: 6E77A590E3F6D71C

View file

@ -134,7 +134,6 @@ func main() {
MinVersion: tls.VersionTLS12,
}
if cf.Settings.TLS.MinVersion != "" {
var err error
tlsConfig.MinVersion, err = ParseTLSVersion(cf.Settings.TLS.MinVersion)
if err != nil {
@ -150,6 +149,9 @@ func main() {
os.Exit(1)
}
}
if tlsConfig.MinVersion == tls.VersionTLS10 || tlsConfig.MinVersion == tls.VersionTLS11 {
fmt.Fprintf(os.Stderr, "warning: using of a deprecated TLS version (< 1.2) is not recommended\n")
}
// Create self-signed certificate, when no keyfile and no certificates are present
if cf.Settings.TLS.Keyfile == "" && len(cf.Settings.TLS.Certificates) == 0 {
// TODO