From 222bfa8d1266eedf401df5474a638c042ab442e2 Mon Sep 17 00:00:00 2001 From: Joseph Birr-Pixton Date: Sat, 11 Apr 2020 17:02:24 +0100 Subject: [PATCH] TLS1.3: swallow user_cancelled warning alerts --- rustls/src/session.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rustls/src/session.rs b/rustls/src/session.rs index f13fa090..7bf4c06d 100644 --- a/rustls/src/session.rs +++ b/rustls/src/session.rs @@ -501,9 +501,10 @@ impl SessionCommon { return Ok(()); } - // Warnings are nonfatal for TLS1.2, but outlawed in TLS1.3. + // Warnings are nonfatal for TLS1.2, but outlawed in TLS1.3 + // (except, for no good reason, user_cancelled). if alert.level == AlertLevel::Warning { - if self.is_tls13() { + if self.is_tls13() && alert.description != AlertDescription::UserCanceled { self.send_fatal_alert(AlertDescription::DecodeError); } else { warn!("TLS alert warning received: {:#?}", msg);