Server TLS
Start server without TLS by default
This commit is contained in:
parent
afb29670c8
commit
beab244bce
12
server.go
12
server.go
@ -247,12 +247,14 @@ func StartServer() {
|
||||
// certFile = fullchain.pem
|
||||
// keyFile = privkey.pem
|
||||
|
||||
// comment the following block to disable TLS
|
||||
// uncomment the following block to enable TLS; edit cert files first
|
||||
/*
|
||||
cert, err := tls.LoadX509KeyPair("/etc/letsencrypt/live/mg25ot4aggt8dprv.myfritz.net/fullchain.pem", "/etc/letsencrypt/live/mg25ot4aggt8dprv.myfritz.net/privkey.pem")
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
os.Exit(2)
|
||||
}
|
||||
*/
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/ws", webSocketHandler)
|
||||
@ -260,10 +262,10 @@ func StartServer() {
|
||||
srv := nbhttp.NewServer(nbhttp.Config{
|
||||
Network: "tcp",
|
||||
Handler: mux,
|
||||
// comment the following 2 lines and uncomment "Addrs" to start server without TLS
|
||||
AddrsTLS: []string{cfg.Settings.ListenAddress},
|
||||
TLSConfig: &tls.Config{Certificates: []tls.Certificate{cert}},
|
||||
//Addrs: []string{cfg.Settings.ListenAddress},
|
||||
// uncomment the following 2 lines and comment "Addrs" to start server with TLS
|
||||
//AddrsTLS: []string{cfg.Settings.ListenAddress},
|
||||
//TLSConfig: &tls.Config{Certificates: []tls.Certificate{cert}},
|
||||
Addrs: []string{cfg.Settings.ListenAddress},
|
||||
})
|
||||
|
||||
err = srv.Start()
|
||||
|
Loading…
Reference in New Issue
Block a user