Push notification - Caused by: java.io.IOException: toDerInputStream rejects tag type 45

后端 未结 2 2447
悲&欢浪女
悲&欢浪女 2021-01-02 03:40

I got this error when my server try to push a notification to a specific device based on device token and ck.pem (combination between .pem file, cert and key).



        
相关标签:
2条回答
  • 2021-01-02 03:49

    As stated here java-apns is expecting the .p12 private key, not the .pem file.

    The instructions for creating a .p12 file on a mac are in the first link, but if you're using the openssl tool on linux you can create it with:

    openssl pkcs12 -export -inkey mykey.key -in mykey.pem -out mykey.p12
    
    0 讨论(0)
  • 2021-01-02 04:02

    I just found the answer. When I try to generate a P12 key, I need to select both, a private key and certificate in keychain access.

    enter image description here

    0 讨论(0)
提交回复
热议问题