handle TLS attack

included net attack count on non supported tls connection
counted as attack for tls without client cert and missing quote on tls client cert
This commit is contained in:
Noor 2025-01-01 23:37:32 +00:00
parent 8226f03e7c
commit 9e9036280d
Signed by: noormohammedb
GPG Key ID: 7680BB1B83C6A443

@ -93,7 +93,14 @@ impl NodeServer {
let conn = if let Err(e) = conn {
println!("Error accepting TLS connection: {e}");
if e.to_string().contains("HandshakeFailure") {
let attack_error_messages = [
"HandshakeFailure",
"peer sent no certificates", // "NoCertificatesPresented",
"Not found quote extension",
];
let err_str = e.to_string();
if attack_error_messages.iter().any(|att_er_str| err_str.contains(att_er_str)) {
state.increase_net_attacks().await;
}
return;