Implement TLS server

$ ./minio --tls --cert <your_cert> --key <your_private_key>

This patchset also provides crypto/x509 - which is a wrapper package
to generate X509 certificates.

This is necessary to provide certificates later through management console
This commit is contained in:
Harshavardhana
2015-01-25 17:15:18 -08:00
parent 4b586a51cf
commit 063832baaf
23 changed files with 3435 additions and 10 deletions

View File

@@ -0,0 +1,29 @@
package httpserver
import "crypto/tls"
func getDefaultTLSConfig() *tls.Config {
config := &tls.Config{}
//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,
}
//Use only TLS v1.2
config.MinVersion = tls.VersionTLS12
// Ignore client auth for now
config.ClientAuth = tls.NoClientCert
//Don't allow session resumption
config.SessionTicketsDisabled = true
return config
}