use secure ssl configuation

This commit is contained in:
root
2022-02-16 17:47:29 +00:00
parent 311b0dbff3
commit da85891848

View File

@@ -7,6 +7,7 @@ import (
"compress/gzip"
"context"
"crypto/md5"
"crypto/tls"
"encoding/hex"
"errors"
"flag"
@@ -618,7 +619,22 @@ func main() {
initCaptcha(hash)
router := e.setupRouter()
router = e.setupConfRouter(router)
srv := &http.Server{Addr: cfg.Server.Host + ":" + cfg.Server.Port, Handler: reqMiddleware(router)}
tlsConfig := &tls.Config{
MinVersion: tls.VersionTLS12,
CipherSuites: []uint16{
tls.TLS_AES_256_GCM_SHA384,
tls.TLS_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
//tls.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
//tls.TLS_DHE_RSA_WITH_AES_256_CCM_8,
//tls.TLS_DHE_RSA_WITH_AES_256_CCM,
//tls.TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
//tls.TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
},
}
srv := &http.Server{Addr: cfg.Server.Host + ":" + cfg.Server.Port, Handler: reqMiddleware(router), TLSConfig: tlsConfig}
stop := make(chan os.Signal, 2)
signal.Notify(stop, os.Interrupt, syscall.SIGTERM)