mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix #283 (remove unnecessary log.Fatal)
The server should never crash during rehash, even if the config is invalid.
This commit is contained in:
parent
a72de2f4d2
commit
3c12fb6254
5 changed files with 45 additions and 34 deletions
|
|
@ -410,17 +410,17 @@ func (conf *Config) Operators(oc map[string]*OperClass) (map[string]*Oper, error
|
|||
}
|
||||
|
||||
// TLSListeners returns a list of TLS listeners and their configs.
|
||||
func (conf *Config) TLSListeners() map[string]*tls.Config {
|
||||
func (conf *Config) TLSListeners() (map[string]*tls.Config, error) {
|
||||
tlsListeners := make(map[string]*tls.Config)
|
||||
for s, tlsListenersConf := range conf.Server.TLSListeners {
|
||||
config, err := tlsListenersConf.Config()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return nil, err
|
||||
}
|
||||
config.ClientAuth = tls.RequestClientCert
|
||||
tlsListeners[s] = config
|
||||
}
|
||||
return tlsListeners
|
||||
return tlsListeners, nil
|
||||
}
|
||||
|
||||
// LoadConfig loads the given YAML configuration file.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue