Closed gregorskii closed 9 years ago
Hey,
I'm currently using PyAPNs in a GAE project and I am not seeing any errors.
A few advices:
If you're still seeing problems check if you're not sending messages to sandboxed tokens without "use_sandbox = True" (or vice versa).
Thanks @CTassisF
We are loading the certificates like this and it worked previously:
##
# APNS
##
APNS_CERT_SANDBOX = os.path.join(os.path.dirname(__file__), 'apns_keys/development_cert.pem')
APNS_PEM_SANDBOX = os.path.join(os.path.dirname(__file__), 'apns_keys/development_key.pem')
APNS_CERT_PRODUCTION = os.path.join(os.path.dirname(__file__), 'apns_keys/production_key.pem')
APNS_PEM_PRODUCTION = os.path.join(os.path.dirname(__file__), 'apns_keys/production_key.pem')
And we are not getting any SSL errors with the certs.
@gregorskii I had a few problems loading certificates from files when I started using PyAPNs on GAE and that's why I'm using StringIO.StringIO(). I'm also not using the latest PyAPNs version available (v2.0.1), I'm using v2.0 because of #108. This is the log when my push'es are sent:
D 2015-02-20 19:23:40.333 GatewayConnection APNS connection establishing... D 2015-02-20 19:23:40.618 GatewayConnection APNS connection established I 2015-02-20 19:23:40.627 GatewayConnection APNS connection closed
Your log matches mine. I can't think anything but wrong token/sandbox combinations or problems with certificate loading.
I believe I am using the most current version, however the files do not denote the version anywhere that I can see.
I am pulling from https://github.com/djacobs/PyAPNs.git I do not remember specifically the last time I reran pip install -r from my requirements file. But I believe it was recently. I can try that again.
If the certificate did not load wouldn't the call to APNS throw a SSL connection error? When we were messing with the certs last night and had it setup wrong it was indeed throwing an error which resulted in a 500 error to our front end.
I will try rebuilding my package requirements, but its good that someone else is using this plugin on App Engine and having success, we must just have a config issue somewhere.
If you or anyone else has any other suggestions we would greatly appreciate it.
Thanks!
I tried updating the modules via pip install -r from my requirements file. I also tried using StringIO.StringIO to read the cert files. Neither worked.
I am still at a loss for how to fix this.
Does anyone know of any other debugging techniques to get more detail into what is happening?
Thanks
If it helps I had the same problem, turned out my cert file was wrong.
Would you mind adding the instructions you used to create the key and load it in app engine? The ones I used are above.
I would really appreciate it.
I changed enhanced mode to True and the pushes started sending. Can anyone explain why enhanced False and enhanced True would cause this to happen?
Resolved by using enhanced=True
Hi there,
We are using this plugin on Google App Engine with a Cloud Endpoints project.
Several months back when we were testing the integration the push messages were sending.
We have not made any major modifications to our push code and now the messages are not sending.
The App Engine logs show:
and does not report any 500 errors or SSL/key errors. But the message is not received by the phone.
We are also getting "Deadline Exceeded Errors" at least one of the times we tried.
Our keys are signed correctly using this process:
in keychain access, select both cert and key then export to Certificates.p12 file.
to generate cert.pem openssl pkcs12 -in Certificates.p12 -out cert.pem -nodes -nokeys
to generate key.pem openssl pkcs12 -in Certificates.p12 -out key.pem -nodes -nocerts
Our push code is copied directly from the instructions:
We are mimicking Urban Airship like functionality.
And the keys are set as such:
We are using Googles own SSL library via the app.yaml:
Any help would be greatly appreciated. Let me know if you need more information.