From 3828b59c016981d850c10027a6538c67337820d1 Mon Sep 17 00:00:00 2001 From: Max Kalashnikoff Date: Wed, 10 Jul 2024 16:50:39 +0200 Subject: [PATCH] fix(apns): proper catching of Unknown CA error --- src/providers/apns.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/providers/apns.rs b/src/providers/apns.rs index 86bc63e..a918c82 100644 --- a/src/providers/apns.rs +++ b/src/providers/apns.rs @@ -160,9 +160,15 @@ impl PushProvider for ApnsProvider { info!("APNs certificate expired: debug:{dbg}, display: {hyper_error}"); Err(Error::ApnsCertificateExpired) } + _ => Err(Error::Apns(e)), + } + } + a2::Error::ClientError(ref client_error) => { + let dbg = format!("{client_error:?}"); + match dbg { dbg if dbg.contains("received fatal alert: UnknownCA") => { info!( - "APNs certificate unknown CA: debug:{dbg}, display: {hyper_error}" + "APNs certificate unknown CA: debug:{dbg}, display: {client_error}" ); Err(Error::ApnsCertificateUnknownCA) }