Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8796173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:33:40+00:00 2026-06-13T23:33:40+00:00

I am using the apn module (https://github.com/argon/node-apn) to send push notifications to iPhones from

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:33:41+00:00Added an answer on June 13, 2026 at 11:33 pm

    I struggled a lot with this issue until I realized that I hadn’t understood how the fs module reads files. Apparently, it reads them from the directory where you started your node process. So the path to your .pem files should be relative to wherever you’re doing that.

    You might wanna check out __dirname too, which might make it easier to specify your paths.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i am using the gem https://github.com/PRX/apn_on_rails.git and followed the instructions to send push
I am using PHP to connect to apn s to send some notifications to
I am developing a rails application which should send push notifications to iOS devices.
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
In my iphone application i want Device Token using the APN. How to get
I'm using resque/redis on heroku to send emails as a background job. It works
We had no problem sending notifications to provisioned devices using the development certification and
I want to create APN by code, is there any support in Android SDK,
I have the following code which I use to send a request to the
Using mercurial, I've run into an odd problem where a line from one committer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.