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:
		
							parent
							
								
									ad9c445fe5
								
							
						
					
					
						commit
						e86ee534ed
					
				| @ -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