Scala APNS handshake failure

I am trying to send a push notification to an apple device (iphone) using Scala and Notnoop APNS , but when I ran this code:

import com.notnoop.apns._
val service = APNS.newService().withCert("certfile.p12", "passphrase").withAppleDestination(true).build()

service.start()

val payload = APNS.newPayload().alertBody("nomnomnom").sound("default")

service.push("deviceToken", payload.build())

service.stop()

I was always stuck with this, ssl handshake error:

Thread-20, handling exception: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

based on this question , I may have the wrong certificate, but I'm sure this certificate works, because using this PHP example , I can send a push notification.

Any idea where my process went wrong?

+4
source share

Source: https://habr.com/ru/post/1529227/


All Articles