Meteor-Community-Packages / raix-push

DEPRECATED: Push notifications for cordova (ios, android) browser (Chrome, Safari, Firefox)
https://atmospherejs.com/raix/push
MIT License
515 stars 197 forks source link

Socket unusable after connection. Hint: You may be using a certificate for the wrong environment #165

Closed derwaldgeist closed 8 years ago

derwaldgeist commented 8 years ago

I tried out the meteor-raix-push-demo app and updated it to Meteor 1.2 and the latest version of raix:push. Although my certificates are reported OK when testing against the APN service, I get the following error in the console each time I try to send a notification:

W20151213-10:27:20.357(1)? (STDERR) /Users/waldgeist/.meteor/packages/raix_push/.3.0.2.838gkc++os+web.browser+web.cordova/npm/node_modules/apn/node_modules/q/q.js:155
W20151213-10:27:20.357(1)? (STDERR)                 throw e;
W20151213-10:27:20.358(1)? (STDERR)                       ^
W20151213-10:27:20.358(1)? (STDERR) Error: Socket unusable after connection. Hint: You may be using a certificate for the wrong environment
W20151213-10:27:20.358(1)? (STDERR)     at Connection.connect.delay.then.fail.delay (/Users/waldgeist/.meteor/packages/raix_push/.3.0.2.838gkc++os+web.browser+web.cordova/npm/node_modules/apn/lib/connection.js:224:10)
W20151213-10:27:20.358(1)? (STDERR)     at _fulfilled (/Users/waldgeist/.meteor/packages/raix_push/.3.0.2.838gkc++os+web.browser+web.cordova/npm/node_modules/apn/node_modules/q/q.js:834:54)
W20151213-10:27:20.358(1)? (STDERR)     at self.promiseDispatch.done (/Users/waldgeist/.meteor/packages/raix_push/.3.0.2.838gkc++os+web.browser+web.cordova/npm/node_modules/apn/node_modules/q/q.js:863:30)
W20151213-10:27:20.358(1)? (STDERR)     at Promise.promise.promiseDispatch (/Users/waldgeist/.meteor/packages/raix_push/.3.0.2.838gkc++os+web.browser+web.cordova/npm/node_modules/apn/node_modules/q/q.js:796:13)
W20151213-10:27:20.358(1)? (STDERR)     at /Users/waldgeist/.meteor/packages/raix_push/.3.0.2.838gkc++os+web.browser+web.cordova/npm/node_modules/apn/node_modules/q/q.js:604:44
W20151213-10:27:20.359(1)? (STDERR)     at runSingle (/Users/waldgeist/.meteor/packages/raix_push/.3.0.2.838gkc++os+web.browser+web.cordova/npm/node_modules/apn/node_modules/q/q.js:137:13)
W20151213-10:27:20.359(1)? (STDERR)     at flush (/Users/waldgeist/.meteor/packages/raix_push/.3.0.2.838gkc++os+web.browser+web.cordova/npm/node_modules/apn/node_modules/q/q.js:125:13)
W20151213-10:27:20.359(1)? (STDERR)     at process._tickCallback (node.js:448:13)
=> Exited with code: 8
W20151213-10:27:24.355(1)? (STDERR) WARNING: Push APN is using development key and certificate

After reading #134, I also explicitly set the NODE_ENV variable to "development" (which wasn't present before), but this did not change anything. I am testing on a localhost, and in the json the production flag is set to false, so it should take the development cert and key.

derwaldgeist commented 8 years ago

My fault. I used the apn-dev key instead of apn and vice-versa.

Mani-87 commented 3 years ago

I am new to work IOS push notifications and getting below error my certificate validate upto september 2022 on production mode

Error: Socket unusable after connection. Hint: You may be using a certificate for the wrong environment at Connection. (/home/gettaskrabbit/tdemo/node_modules/apn/lib/connection.js:259:10) at _fulfilled (/home/gettaskrabbit/tdemo/node_modules/q/q.js:834:54) at self.promiseDispatch.done (/home/gettaskrabbit/tdemo/node_modules/q/q.js:863:30) at Promise.promise.promiseDispatch (/home/gettaskrabbit/tdemo/node_modules/q/q.js:796:13) at /home/gettaskrabbit/tdemo/node_modules/q/q.js:604:44 at runSingle (/home/gettaskrabbit/tdemo/node_modules/q/q.js:137:13) at flush (/home/gettaskrabbit/tdemo/node_modules/q/q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickDomainCallback (internal/process/next_tick.js:218:9) kindly suggest someone to fix this

jatinshrivastava commented 3 years ago

@derwaldgeist how did u generate the pem file for key and certificate? Can you share the commands? I tried the commands mentioned in: https://github.com/raix/push/blob/v3.x/docs/IOS.md but still I am getting this same error. Thanks in advance. :)

paulo-ridery commented 8 months ago

@jatinshrivastava did you solve it? I am getting the same error