Merge pull request #519 from philips/fixup-server-tls-client-config

fix(server): fix client certificate verification
This commit is contained in:
Brandon Philips
2014-02-03 17:33:45 -08:00
4 changed files with 230 additions and 7 deletions

View File

@@ -16,11 +16,15 @@ func NewListener(addr string) (net.Listener, error) {
return l, nil
}
func NewTLSListener(addr, certFile, keyFile string) (net.Listener, error) {
func NewTLSListener(config *tls.Config, addr, certFile, keyFile string) (net.Listener, error) {
if addr == "" {
addr = ":https"
}
config := &tls.Config{}
if config == nil {
config = &tls.Config{}
}
config.NextProtos = []string{"http/1.1"}
var err error

View File

@@ -6,7 +6,7 @@ import (
// TLSConfig holds the TLS configuration.
type TLSConfig struct {
Scheme string
Server tls.Config
Client tls.Config
Scheme string // http or https
Server tls.Config // Used by the Raft or etcd Server transporter.
Client tls.Config // Used by the Raft peer client.
}