Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tars/servanthandle.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (a *application) AddHttpServantWithExceptionStatusChecker(mux HttpHandler,
ExceptionStatusChecker: exceptionStatusChecker,
}
mux.SetConfig(httpConf)
s := &http.Server{Addr: cfg.Address, Handler: mux, TLSConfig: cfg.TlsConfig}
s := &http.Server{Addr: cfg.Address, Handler: mux, TLSConfig: cfg.TlsConfig, ReadTimeout: cfg.ReadTimeout, WriteTimeout: cfg.WriteTimeout, IdleTimeout: cfg.IdleTimeout}
a.httpSvrs[obj] = s
}

Expand Down
19 changes: 19 additions & 0 deletions tars/util/ssl/ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ var log = rogger.GetLogger("ssl")

func NewServerTlsConfig(ca, cert, key string, verifyClient bool, ciphers string) (tlsConfig *tls.Config, err error) {
tlsConfig = &tls.Config{}

tlsConfig.CipherSuites = []uint16{
tls.TLS_AES_128_GCM_SHA256,
tls.TLS_CHACHA20_POLY1305_SHA256,
tls.TLS_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
}

if ca != "" {
certBytes, err := ioutil.ReadFile(ca)
if err != nil {
Expand Down