Open platform to collect and prioritize feedback
enhancement: Remove support for TLS 1.0, TLS 1.1 and old ciphers (#420)
Guilherme Oenningc797f357e3bf
diff --git a/app/pkg/web/engine.go b/app/pkg/web/engine.goindex d2d9cd506..d969f090d 100644--- a/app/pkg/web/engine.go+++ b/app/pkg/web/engine.go@@ -2,7 +2,6 @@ package webimport ("context"- "crypto/tls""fmt"stdLog "log""net/http"@@ -94,6 +93,7 @@ func (e *Engine) Start(address string) {Addr: address,Handler: e.mux,ErrorLog: stdLog.New(e.logger, "", 0),+ TLSConfig: getDefaultTLSConfig(),}for i := 0; i < runtime.NumCPU()*2; i++ {@@ -110,10 +110,7 @@ func (e *Engine) Start(address string) {panic(errors.Wrap(err, "failed to initialize CertificateManager"))}- e.server.TLSConfig = &tls.Config{- GetCertificate: certManager.GetCertificate,- }-+ e.server.TLSConfig.GetCertificate = certManager.GetCertificatee.logger.Infof("https (auto ssl) server started on %s", address)go certManager.StartHTTPServer()err = e.server.ListenAndServeTLS("", "")diff --git a/app/pkg/web/ssl.go b/app/pkg/web/ssl.goindex ca4eb7241..a19adc8e2 100644--- a/app/pkg/web/ssl.go+++ b/app/pkg/web/ssl.go@@ -10,6 +10,30 @@ import ("golang.org/x/crypto/acme/autocert")+func getDefaultTLSConfig() *tls.Config {+ return &tls.Config{+ MinVersion: tls.VersionTLS12,+ MaxVersion: tls.VersionTLS12,+ PreferServerCipherSuites: true,+ CurvePreferences: []tls.CurveID{+ tls.X25519,+ tls.CurveP256,+ },+ CipherSuites: []uint16{+ tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,+ tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,+ tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,+ tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,+ tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,+ tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,+ tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,+ tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,+ tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,+ tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,+ },+ }+}+//CertificateManager is used to manage SSL certificatestype CertificateManager struct {cert tls.Certificate