I am using the apn module (https://github.com/argon/node-apn) to send push notifications to iPhones from NodeJS.
My code works fine on my development machine (Mac OSX) and is successfully pushing notifications through the Apple sandbox gateway (gateway.sandbox.push.apple.com), but when I move it to the staging server (which is running Ubuntu) pushing notifications fails with the message:
Error: ENOENT, no such file or directory 'apns-dev-cert.pem'
I am setting up the NodeJS apn object as such:
var options = {
cert: "apns-dev-cert.pem",
key: "apns-key.pem",
passphrase: null,
gateway: "gateway.sandbox.push.apple.com",
port: 2195,
enhanced: true,
errorCallback: undefined,
cacheLength: 5
};
On my development Mac OSX machine, the cert is installed in the Keychain. From my limited understanding of Ubuntu, the equivalent would be to copy the cert file to /etc/ssl/certs. I tried doing this, and also changing the path to "/etc/ssl/certs/apn-dev-cert.pem" in my NodeJS code, but the same error message shows up.
Any ideas?