mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 00:13:47 +03:00
prevent panic when starting with a mox.conf that references an ACME provider that isn't configured
the error handling code attempts to collect all error messages it encounters, to print them all at the end, so you can fix them all before trying again. so we try to continue preparing the config after an error. in this case, we continued as if acme.Manager was properly set and nil-dereferenced it. for issue #2, from hismailbulut
This commit is contained in:
parent
cc3a2c9bc8
commit
8affa12c39
1 changed files with 3 additions and 3 deletions
|
@ -431,10 +431,10 @@ func PrepareStaticConfig(ctx context.Context, configFile string, config *Config,
|
|||
addErrorf("listener %q: unknown ACME provider %q", name, l.TLS.ACME)
|
||||
}
|
||||
|
||||
// If only checking, we don't have an acme manager, so set an empty tls config to
|
||||
// continue without errors.
|
||||
// If only checking or with missing ACME definition, we don't have an acme manager,
|
||||
// so set an empty tls config to continue.
|
||||
var tlsconfig *tls.Config
|
||||
if checkOnly {
|
||||
if checkOnly || acme.Manager == nil {
|
||||
tlsconfig = &tls.Config{}
|
||||
} else {
|
||||
tlsconfig = acme.Manager.TLSConfig.Clone()
|
||||
|
|
Loading…
Reference in a new issue