diff --git a/crates/buzz-push-gateway/Cargo.toml b/crates/buzz-push-gateway/Cargo.toml index aec3c43b02..9c092f7d1d 100644 --- a/crates/buzz-push-gateway/Cargo.toml +++ b/crates/buzz-push-gateway/Cargo.toml @@ -31,7 +31,7 @@ metrics-exporter-prometheus = { workspace = true } nostr = { workspace = true } p256 = { version = "0.14", features = ["ecdsa", "pem", "pkcs8"] } rand = { workspace = true } -reqwest = { workspace = true } +reqwest = { workspace = true, features = ["http2"] } serde = { workspace = true } serde_json = { workspace = true } sqlx = { workspace = true } diff --git a/crates/buzz-push-gateway/src/apns.rs b/crates/buzz-push-gateway/src/apns.rs index 8f6f182000..e6d96b2866 100644 --- a/crates/buzz-push-gateway/src/apns.rs +++ b/crates/buzz-push-gateway/src/apns.rs @@ -116,6 +116,9 @@ impl ApnsTransport { /// Build a reusable APNs client from an Apple `.p8` private key. pub fn token(p8: &[u8], key_id: &str, team_id: &str, topic: String) -> Result { let client = reqwest::Client::builder() + // APNs requires HTTP/2. This no-op method reference is intentionally + // feature-gated so removing reqwest's `http2` feature fails the build. + .http2_keep_alive_while_idle(false) .timeout(Duration::from_secs(15)) .build() .map_err(|_| ApnsError::Client)?;