SSL name is deprecated, use TLS instead

This commit is contained in:
Sergey Matveev 2014-06-10 11:26:13 +04:00
parent eb4b0917b3
commit 1a2241388b

View File

@ -35,9 +35,8 @@ var (
logdir = flag.String("logdir", "", "Absolute path to directory for logs") logdir = flag.String("logdir", "", "Absolute path to directory for logs")
statedir = flag.String("statedir", "", "Absolute path to directory for states") statedir = flag.String("statedir", "", "Absolute path to directory for states")
ssl = flag.Bool("ssl", false, "Use SSL only.") tlsKey = flag.String("tls_key", "", "TLS keyfile")
sslKey = flag.String("ssl_key", "", "SSL keyfile.") tlsCert = flag.String("tls_cert", "", "TLS certificate")
sslCert = flag.String("ssl_cert", "", "SSL certificate.")
verbose = flag.Bool("v", false, "Enable verbose logging.") verbose = flag.Bool("v", false, "Enable verbose logging.")
) )
@ -100,10 +99,10 @@ func Run() {
} }
var listener net.Listener var listener net.Listener
if *ssl { if *tlsKey != "" {
cert, err := tls.LoadX509KeyPair(*sslCert, *sslKey) cert, err := tls.LoadX509KeyPair(*tlsCert, *tlsKey)
if err != nil { if err != nil {
log.Fatalf("Could not load SSL keys from %s and %s: %s", *sslCert, *sslKey, err) log.Fatalf("Could not load TLS keys from %s and %s: %s", *tlsCert, *tlsKey, err)
} }
config := tls.Config{Certificates: []tls.Certificate{cert}} config := tls.Config{Certificates: []tls.Certificate{cert}}
listener, err = tls.Listen("tcp", *bind, &config) listener, err = tls.Listen("tcp", *bind, &config)