Skip to content

Commit

Permalink
fix(apns): proper catching of Unknown CA error (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother committed Jul 10, 2024
1 parent 12794b1 commit cee0298
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/providers/apns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit cee0298

Please sign in to comment.