Skip to content

Commit cf976f3

Browse files
authored
fix(apns): handling of the certificate expiration error (#364)
1 parent 62b243c commit cf976f3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/providers/apns.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ impl PushProvider for ApnsProvider {
175175
);
176176
Err(Error::ApnsCertificateUnknownCA)
177177
}
178+
dbg if dbg.contains("received fatal alert: CertificateExpired") => {
179+
info!("APNs certificate expired: debug:{dbg}, display: {client_error}");
180+
Err(Error::ApnsCertificateExpired)
181+
}
178182
_ => Err(Error::Apns(e)),
179183
}
180184
}

src/state.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ pub fn new_state(
7979
#[cfg(feature = "multitenant")]
8080
let jwt_secret = config.jwt_secret.clone();
8181

82-
let public_ip = match networking::find_public_ip_addr() {
83-
Ok(ip) => Some(ip),
84-
// Note: Should we pass this error back up?
85-
Err(_e) => None,
86-
};
82+
let public_ip = networking::find_public_ip_addr().ok();
8783

8884
Ok(AppState {
8985
config: config.clone(),

0 commit comments

Comments
 (0)