You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Apple SSL certificate updated. How do I get Pigeon to use the new pem on the active server? #292
Our Apple SSL certificate expired yesterday in our environment sending pushes through Pigeon. I have the certificate defined in the config file using file.read!. Now that I've got a new pem file, is there a way to install that on the operating server running the app, and update the environment variables to read the new pem and use it?
I tried creating a new value for the Application.put_env(:myapp, Myapp.APNS.Prod) with the cert containing the new content, then tried restarting the process Myapp.APNS.Prod, but I'm still being flooded with errors like [info] function=decode/3 line=136 module=ssl_alert TLS :client: In state :connection received SERVER ALERT: Fatal - Certificate Expired
Expected behavior
I'm hoping not to have to build a new load every year when the APPLE certs expire, So I need a way to install the pem in the running system and get the system to make use of it.
How do I update the config on a running system and get it to take effect?
The Certificate Expired Errors are happening about 5-6 times per second. What is causing that, and is there anything I can do to throttle that back. I don't want to get blacklisted by Apple.
@nkezhaya I did end up having to create a new build to solve this, but it should prevent having to do it again next year. Move the configuration of your adapters into config/runtime.exs instead of config/config.exs. Since I was reading the pem files in the config I had to change the File.read! to insert the application directory in front, but it should work fine when you update the pems later and just reload.
That is: cert: File.read!(Path.join(Application.app_dir(:myapp), "priv/aps.pem"))
This is on my roadmap to address this year and make the developer quality of life a little better. The crashing and reconnecting has been a long standing issue with how Kadabra was originally designed, so I will likely switch to mint/finch to handle connections and implement some sort of graceful unauthorized error on push dispatch. That said, you still have to be disciplined to renew certs on time.
If you don't want to have to renew certs every year, I recommend switching to the JWT setup. Example config is in the docs.
@Sinc63 Did you ever figure this out? I'm also running into this issue.
I'm also running into this issue. My setup is a bit problematic in that scenario thought, because I'm using a dispatcher with an open connection and I use certificates saved in a database. It is the client, not me who uploads and keeps certificates up to date. So if the cert is expired, I have no control over updating it and I'm flooded with these TLS errors mentioned earlier which also causes memory leak I think.
As I said above, I changed my configuration for the certificates to be in
the runtime config. With what you say about things, after you change to a
runtime model the client that is uploading the certificates to your
database will also have to upload them to the system and reboot.
Sinc
Activity
Sinc63 commentedon Feb 13, 2025
The Certificate Expired Errors are happening about 5-6 times per second. What is causing that, and is there anything I can do to throttle that back. I don't want to get blacklisted by Apple.
nkezhaya commentedon Feb 20, 2025
@Sinc63 Did you ever figure this out? I'm also running into this issue.
Sinc63 commentedon Feb 22, 2025
@nkezhaya I did end up having to create a new build to solve this, but it should prevent having to do it again next year. Move the configuration of your adapters into config/runtime.exs instead of config/config.exs. Since I was reading the pem files in the config I had to change the File.read! to insert the application directory in front, but it should work fine when you update the pems later and just reload.
That is:
cert: File.read!(Path.join(Application.app_dir(:myapp), "priv/aps.pem"))hpopp commentedon Feb 22, 2025
This is on my roadmap to address this year and make the developer quality of life a little better. The crashing and reconnecting has been a long standing issue with how Kadabra was originally designed, so I will likely switch to mint/finch to handle connections and implement some sort of graceful unauthorized error on push dispatch. That said, you still have to be disciplined to renew certs on time.
If you don't want to have to renew certs every year, I recommend switching to the JWT setup. Example config is in the docs.
lukasz-szulborski commentedon Apr 30, 2025
I'm also running into this issue. My setup is a bit problematic in that scenario thought, because I'm using a dispatcher with an open connection and I use certificates saved in a database. It is the client, not me who uploads and keeps certificates up to date. So if the cert is expired, I have no control over updating it and I'm flooded with these TLS errors mentioned earlier which also causes memory leak I think.
Sinc63 commentedon May 7, 2025