Openssl 播放2.2 java apns SSLHandshakeException

Openssl 播放2.2 java apns SSLHandshakeException,openssl,apple-push-notifications,playframework-2.2,javaapns,Openssl,Apple Push Notifications,Playframework 2.2,Javaapns,我的环境是Ubuntu12.04+Play2.2.2+Java7+JavaAPNS0.2.3 在我从苹果下载aps_development并安装到我的密钥链之后,我将证书和私钥导出到Dev_Certificates.p12。我把它放在conf/certs/Dev_Certificates.p12下。这是我得到的错误: pool-7-thread-1, WRITE: TLSv1 Handshake, length = 48 pool-7-thread-1, READ: TLSv1 Alert, l

我的环境是Ubuntu12.04+Play2.2.2+Java7+JavaAPNS0.2.3

在我从苹果下载aps_development并安装到我的密钥链之后,我将证书和私钥导出到Dev_Certificates.p12。我把它放在conf/certs/Dev_Certificates.p12下。这是我得到的错误:

pool-7-thread-1, WRITE: TLSv1 Handshake, length = 48
pool-7-thread-1, READ: TLSv1 Alert, length = 2
pool-7-thread-1, RECV TLSv1 ALERT:  fatal, handshake_failure
%% Invalidated:  [Session-3, TLS_RSA_WITH_AES_128_CBC_SHA]
pool-7-thread-1, called closeSocket()
pool-7-thread-1, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
pool-7-thread-1, called close()
pool-7-thread-1, called closeInternal(true)
Thread-13, handling exception: java.net.SocketException: Socket is closed
[error] application - ConnectionClosed MessageID: -1 Error: UNKNOWN
[error] c.n.a.i.ApnsConnectionImpl - Couldn't send message after 3 retries.Message(Id=1; Token=62303732366363653231353337356337313133303637373437643839333738323631626662356139663037633234386366613034346635643737353031376635; Payload={"aps":{"alert":{"loc-args":["angelokh"],"action-loc-key":"REPLY","loc-key":"NEW_MESSAGE_PUSH_FORMAT"},"badge":0},"extra":{"traversableAgain":true,"empty":false}})
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) ~[na:1.7.0_55]
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) ~[na:1.7.0_55]
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1959) ~[na:1.7.0_55]
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077) ~[na:1.7.0_55]
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) ~[na:1.7.0_55]
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702) ~[na:1.7.0_55]
[error] application - MessageSendFailed Msg: Message(Id=1; Token=62303732366363653231353337356337313133303637373437643839333738323631626662356139663037633234386366613034346635643737353031376635; Payload={"aps":{"alert":{"loc-args":["angelokh"],"action-loc-key":"REPLY","loc-key":"NEW_MESSAGE_PUSH_FORMAT"},"badge":0},"extra":{"traversableAgain":true,"empty":false}}) Exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
编辑1:

p12文件位于conf/certs/下。该服务作为def函数创建,并由akka参与者调用

def apnsService = { 
    val certPath = "certs/DEV-APNS-CERT.p12"
    val baseBuilder =
          APNS.newService()
            .asBatched()
            .withCert(getClass.getResourceAsStream(certPath), "password")
     baseBuilder.withSandboxDestination()
}.build

问题是我在用Akka和Scala。我通过更改为getClass.getClassLoader修复了它

APNS.newService()
        .asBatched()
        .withCert(getClass.getClassLoader.getResourceAsStream(certPath), "password")

你在生产中使用这个吗?它稳定吗?