mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 23:20:24 +00:00
proxy protocol: add more logs
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
beff4432dc
commit
60558de728
1 changed files with 3 additions and 0 deletions
|
@ -844,6 +844,7 @@ func getProxyPolicy(allowed, skipped []func(net.IP) bool, def proxyproto.Policy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Something is wrong with the source IP, better reject the
|
// Something is wrong with the source IP, better reject the
|
||||||
// connection.
|
// connection.
|
||||||
|
logger.Error(logSender, "", "reject connection from ip %q, err: %v", connPolicyOptions.Upstream, err)
|
||||||
return proxyproto.REJECT, proxyproto.ErrInvalidUpstream
|
return proxyproto.REJECT, proxyproto.ErrInvalidUpstream
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -863,6 +864,8 @@ func getProxyPolicy(allowed, skipped []func(net.IP) bool, def proxyproto.Policy)
|
||||||
}
|
}
|
||||||
|
|
||||||
if def == proxyproto.REQUIRE {
|
if def == proxyproto.REQUIRE {
|
||||||
|
logger.Debug(logSender, "", "reject connection from ip %q: proxy protocol signature required and not set",
|
||||||
|
upstreamIP)
|
||||||
return proxyproto.REJECT, proxyproto.ErrInvalidUpstream
|
return proxyproto.REJECT, proxyproto.ErrInvalidUpstream
|
||||||
}
|
}
|
||||||
return def, nil
|
return def, nil
|
||||||
|
|
Loading…
Reference in a new issue