Server Dashboard SSL Support
Added a simple if-else statement that checks TLSOnly mode enabled. If enabled, serves the dashboard in HTTPS mode. Otherwise, serves the dashboard in HTTP mode. If TLSCertFile and TLSKeyFile are not used in config but TLSOnly is enabled, the HTTPS dashboard does not loads. Tested on Debian Linux and Windows Server 2012.
This commit is contained in:
parent
c652b8ef07
commit
310fc14261
@ -84,6 +84,10 @@ func (svr *Service) RunDashboardServer(address string) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
go server.Serve(ln)
|
||||
if svr.cfg.TLSOnly {
|
||||
go server.ServeTLS(ln, svr.cfg.TLSCertFile, svr.cfg.TLSKeyFile)
|
||||
} else {
|
||||
go server.Serve(ln)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user