mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
fix: displaying a warning message if the api.rest module authentication is disabled
This commit is contained in:
parent
342d1cf7c9
commit
1afc21ac64
1 changed files with 6 additions and 2 deletions
|
@ -180,6 +180,10 @@ func (api *RestAPI) Configure() error {
|
|||
|
||||
api.server.Handler = router
|
||||
|
||||
if api.username == "" || api.password == "" {
|
||||
log.Warning("api.rest.username and/or api.rest.password parameters are empty, authentication is disabled.")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -192,10 +196,10 @@ func (api *RestAPI) Start() error {
|
|||
var err error
|
||||
|
||||
if api.isTLS() {
|
||||
log.Info("API server starting on https://%s", api.server.Addr)
|
||||
log.Info("api server starting on https://%s", api.server.Addr)
|
||||
err = api.server.ListenAndServeTLS(api.certFile, api.keyFile)
|
||||
} else {
|
||||
log.Info("API server starting on http://%s", api.server.Addr)
|
||||
log.Info("api server starting on http://%s", api.server.Addr)
|
||||
err = api.server.ListenAndServe()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue