Unnecessary configs removed & Read and Write Timeouts added

This commit is contained in:
EMRE ÇELİK 2022-06-25 13:24:58 +03:00 committed by GitHub
parent 807516a553
commit b5ae3d806a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,15 +77,6 @@ func (svr *Service) RunDashboardServer(address string) (err error) {
return err
}
cfg := &tls.Config{
MinVersion: tls.VersionTLS12,
CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
PreferServerCipherSuites: true,
CipherSuites: []uint16{
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
},
Certificates: []tls.Certificate{cer},
}
server := &http.Server{
@ -93,6 +84,8 @@ func (svr *Service) RunDashboardServer(address string) (err error) {
Handler: router,
TLSConfig: cfg,
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler), 0),
ReadTimeout: httpServerReadTimeout,
WriteTimeout: httpServerWriteTimeout,
}
go server.ListenAndServeTLS("", "")
} else {