来自Scala的APNS握手失败

时间:2014-02-27 15:01:32

标签: scala ssl apple-push-notifications javapns

我正在尝试使用Scala和Notnoop APNS向Apple设备(iphone)发送推送通知,但是当我运行此代码时:

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()

我总是坚持这个,ssl握手错误:

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

基于this question,我的证书可能无效,但我确信此证书有效,因为使用this PHP sample,我可以正确发送推送通知。

知道我的流程哪里出错了?

0 个答案:

没有答案