node-apn / node-apn

:calling: Apple Push Notification module for Node.js
MIT License
4.37k stars 681 forks source link

ERR_CRYPTO_OPERATION_FAILED #712

Open hammadali6096 opened 2 years ago

hammadali6096 commented 2 years ago

Hi I am facing an issue when sending voip push notification from remote server(Linux). Here is the screen shot. image

while when I send it from local machine it sent the voip push notification.

Here is the source code: image

superwoou commented 2 years ago

It's issue on node 16. You can use this package on node 16 with pfx (instead of cert / key).

This package should change the default value of pfx on config to undefined, not null.

In node 16, secure context will use null to pfx (https://github.com/nodejs/node/blob/12029ce9e7f2f157c1a8ca60a7eab1c9c68aaa12/lib/internal/tls/secure-context.js#L264)

AbdelrahmanHafez commented 1 year ago

If you're facing ERR_CRYPTO_OPERATION_FAILED, make sure you upgrade Node to the latest version. For me, it was failing at 16.13.1, upgrading to 16.18.0 surprisingly fixes it.

dchahla commented 7 months ago

https://github.com/dchahla/easy-apn of you need it for Node 18