-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending push from Windows #8
Comments
Make sure it's not a DNS issue. Try resolving the FQDN by running the following on the Windows machine:
This should return a list of IPv4 and IPv6 addresses. |
Here is the reuslt Nome: api-vs.push-apple.com.akadns.net So it seems resolved in the right way.
so I think the HTTP/1.1 is not correct. Any idea? |
I don't think it's the HTTP/1.1. That's just a dump of the request before it gets wired through the HTTP/2 connection. The dump shows approximate request data. I recon it's a TLS handshake problem that leads to a timeout, but I can't be 100% sure. Try splitting your Test.p12 into a PEM keypair instead and use those files as cert params. See - https://github.com/petarov/apns-push-cmd?tab=readme-ov-file#extract-keys-from-pkcs12 That's my best guess at the moment. |
I extracted the cert and private key from p12 to to pem, so now the command is apnscmd_windows_386 -cert-file TestCert.pem -cert-key TestPK.pem -token "2af6c2c33ca83e145cba2cd6d296387ba7303ecc1f45b6f6912fb78d766c34bb" -alert-text "Hello" -topic "com.sintesi.ibrama" Anyway, the behavior it's still the same 2024/04/09 09:42:35 Error in HTTP request: Post "https://api.push.apple.com/3/device/2af6c2c33ca83e145cba2cd6d296387ba7303ecc1f45b6f6912fb78d766c34bb": context deadline exceeded (Client.Timeout exceeded while awaiting headers) I'll try to test it in different ways, thanks |
You could use Curl instead and see if that will work with your certificate files, i.e.
I'd be curious to know if that works. |
I already done this test, and it works!
|
The only way I managed to reproduce this on Windows was by using an expired APNS certificate. If you could provide my with some test certificate I could take another look. Otherwise you could check the latest build, if you care trying again. |
I'm trying to use the Windows version to send push notification.
Here is my command prompt:
apnscmd_windows_386 -cert-p12 "Test.p12" -token "2af6c2c33ca83e145cba2cd6d296387ba7303ecc1f45b6f6912fb78d766c34bb" -alert-text "Hello" -topic "com.sintesi.ibrama"
And this is the result:
apns-push-cmd v1.2 - Apple Push Notification service Command Line Push
2024/04/03 17:13:07 Sending... POST https://api.push.apple.com/3/device/2af6c2c33ca83e145cba2cd6d296387ba7303ecc1f45b6f6912fb78d766c34bb
POST /3/device/2af6c2c33ca83e145cba2cd6d296387ba7303ecc1f45b6f6912fb78d766c34bb HTTP/1.1
Host: api.push.apple.com
Apns-Expiration: 0
Apns-Push-Type: alert
Apns-Topic: com.sintesi.ibrama
2024/04/03 17:13:27 Error in HTTP request: Post "https://api.push.apple.com/3/device/2af6c2c33ca83e145cba2cd6d296387ba7303ecc1f45b6f6912fb78d766c34bb": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
Maybe it's related to HTTP/1.1?
I googled this error but it's a generic error, so I really don't know what's wrong.
The text was updated successfully, but these errors were encountered: