Skip to content
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

APNS adapter failure -- cannot find valid connection #15

Closed
tylerarnold opened this issue Apr 26, 2016 · 3 comments
Closed

APNS adapter failure -- cannot find valid connection #15

tylerarnold opened this issue Apr 26, 2016 · 3 comments

Comments

@tylerarnold
Copy link

I receive the following error: "ERR! parse-server-push-adapter APNS cannot find vaild connection for "
when trying to debug push notifications on a local server environment. Note that with the same .p12 key /certificate, I can successfully push notifications to APNS and the same iPhone via a php script running locally.

Environment Setup

parse server 2.27 running on OSX

Steps to reproduce

configure with one installation from app, start server locally with pfx config pointed to .p12 file.
start a APNS push via curl or the parse-dashboard.

Logs/Trace

"verbose: sending push to 1 installations
ERR! parse-server-push-adapter APNS cannot find vaild connection for 768dfdea3b13c3f2ab64dcf3d5fc82e4dd5081189e8d98bf848fa579b848c1a1
/usr/local/lib/node_modules/parse-server/lib/ParseServer.js:329
throw err;
^

Error: mac verify failure
at Error (native)
at Object.createSecureContext (_tls_common.js:132:17)
at Object.TLSSocket._init.ssl.onclienthello.ssl.oncertcb.exports.connect (_tls_wrap.js:972:23)
at apnSocket (/usr/local/lib/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/lib/socket.js:56:19)
at Connection. (/usr/local/lib/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/lib/connection.js:199:17)
at _fulfilled (/usr/local/lib/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:796:13)
at /usr/local/lib/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:604:44
at runSingle (/usr/local/lib/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:137:13)

@tylerarnold
Copy link
Author

I figured this out. my p12 key had a password, which was handled fine in my php script but I forgot about it when I started using it when configuring parse server. Making a version of the p12 without a password fixes the issue.

@flovilmart
Copy link
Contributor

By the way, you can and should have a password on your p12. Just provided it in the adapter options

@achimkoellner
Copy link

new ParseServer({
  ....
  "push": {
    "adapter": new PushAdapter({
       ....
       "ios": [{
          "pfx": 'your-certificate.p12',
          "topic": 'your-app',
          "passphrase": 'your-passphrase',
          "production": true
      ]}
  })
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants