mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
20f92a68e0
commit
b55224b545
1 changed files with 10 additions and 8 deletions
|
@ -124,15 +124,17 @@ func (httpd *HttpServer) Configure() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if core.Exists(certFile) == false || core.Exists(keyFile) == false {
|
||||
log.Info("Generating server TLS key to %s", keyFile)
|
||||
log.Info("Generating server TLS certificate to %s", certFile)
|
||||
if err := tls.Generate(certFile, keyFile); err != nil {
|
||||
return err
|
||||
if certFile != "" && keyFile != "" {
|
||||
if core.Exists(certFile) == false || core.Exists(keyFile) == false {
|
||||
log.Info("Generating server TLS key to %s", keyFile)
|
||||
log.Info("Generating server TLS certificate to %s", certFile)
|
||||
if err := tls.Generate(certFile, keyFile); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
log.Info("Loading server TLS key from %s", keyFile)
|
||||
log.Info("Loading server TLS certificate from %s", certFile)
|
||||
}
|
||||
} else {
|
||||
log.Info("Loading server TLS key from %s", keyFile)
|
||||
log.Info("Loading server TLS certificate from %s", certFile)
|
||||
}
|
||||
|
||||
httpd.certFile = certFile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue