Skip to content

Commit

Permalink
Merge pull request #360 from matrix-org/devon/proxy-fix
Browse files Browse the repository at this point in the history
Explicitly configure the aioapns event loop so proxying works when configured
  • Loading branch information
devonh authored Feb 15, 2024
2 parents e2eaa5c + 4af1120 commit 9c40c7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/360.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue which resulted in proxy configuration being ignored for APNs notifications.
3 changes: 3 additions & 0 deletions sygnal/apnspushkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ async def make_apns() -> aioapns.APNs:
# without this, aioapns will retry every second forever.
self.apns_client.pool.max_connection_attempts = 3

# without this, aioapns will not use the proxy if one is configured.
self.apns_client.pool.loop = loop

def _report_certificate_expiration(self, certfile: str) -> None:
"""Export the epoch time that the certificate expires as a metric."""
with open(certfile, "rb") as f:
Expand Down

0 comments on commit 9c40c7a

Please sign in to comment.