From e7e607b3d7d4712da2b4e516434ed32375a10f04 Mon Sep 17 00:00:00 2001 From: Iwasaki Yudai Date: Mon, 31 Aug 2015 07:16:34 +0900 Subject: [PATCH] Fix TLS crt/key file loading --- app/app.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/app.go b/app/app.go index 901d6a6..31481e1 100644 --- a/app/app.go +++ b/app/app.go @@ -64,8 +64,8 @@ var DefaultOptions = Options{ RandomUrlLength: 8, IndexFile: "", EnableTLS: false, - TLSCrtFile: "~/.gotty.key", - TLSKeyFile: "~/.gotty.crt", + TLSCrtFile: "~/.gotty.crt", + TLSKeyFile: "~/.gotty.key", TitleFormat: "GoTTY - {{ .Command }} ({{ .Hostname }})", EnableReconnect: false, ReconnectTime: 10, @@ -233,10 +233,11 @@ func (app *App) Run() error { &http.Server{Addr: endpoint, Handler: siteHandler}, ) if app.options.EnableTLS { - err = app.server.ListenAndServeTLS( - ExpandHomeDir(app.options.TLSCrtFile), - ExpandHomeDir(app.options.TLSKeyFile), - ) + crtFile := ExpandHomeDir(app.options.TLSCrtFile) + keyFile := ExpandHomeDir(app.options.TLSKeyFile) + log.Printf("TLS crt file: " + crtFile) + log.Printf("TLS key file: " + keyFile) + err = app.server.ListenAndServeTLS(crtFile, keyFile) } else { err = app.server.ListenAndServe() }