handle TLS attack #4
| @ -93,7 +93,14 @@ impl NodeServer { | |||||||
| 
 | 
 | ||||||
|                 let conn = if let Err(e) = conn { |                 let conn = if let Err(e) = conn { | ||||||
|                     println!("Error accepting TLS connection: {e}"); |                     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; |                         state.increase_net_attacks().await; | ||||||
|                     } |                     } | ||||||
|                     return; |                     return; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user