2015-01-25 20:15:18 -05:00
|
|
|
package httpserver
|
|
|
|
|
|
|
|
import "crypto/tls"
|
|
|
|
|
|
|
|
func getDefaultTLSConfig() *tls.Config {
|
2015-01-30 19:49:44 -05:00
|
|
|
config := tls.Config{}
|
2015-01-25 20:15:18 -05:00
|
|
|
|
|
|
|
//Use only modern ciphers
|
|
|
|
config.CipherSuites = []uint16{
|
|
|
|
tls.TLS_RSA_WITH_AES_128_CBC_SHA,
|
|
|
|
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
|
|
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
|
|
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
|
|
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
|
|
|
|
}
|
|
|
|
|
|
|
|
//Don't allow session resumption
|
|
|
|
config.SessionTicketsDisabled = true
|
2015-01-30 19:49:44 -05:00
|
|
|
config.ClientAuth = tls.RequireAnyClientCert
|
|
|
|
return &config
|
2015-01-25 20:15:18 -05:00
|
|
|
}
|