Apple推送通知SSLHandshakeException

时间:2016-07-23 13:04:59

标签: apple-push-notifications ibm-mobilefirst mobilefirst-server

环境:

  1. Windows Server 2012 R2
  2. JRE 1.8.0_101
  3. IBM WAS Liberty Core 8.5.5.5
  4. IBM MFP 7.1.0.00.20150913-2345
  5. 启用APNS端口:

    1. gateway.sandbox.push.apple.com 2195
    2. gateway.push.apple.com 2195
    3. 通过telnet验证它正在连接。

      使用Eclipse studio对iPhone构建进行了测试,它的工作正常,但同样指向远程服务器会出现以下错误。

          [7/23/16 16:02:49:822 GST] 00000126 om.ibm.pushworks.server.notification.apns.ApnsConnectionImpl I Failed to send message Message(Id=2; Token=sdfsadfsdfsdfsdfsdf; Payload={"payload":"{\"tag\":\"Push.ALL\"}","aps":{"alert":{"action-loc-key":null,"body":"مرحبا كيف حالك اليوم؟"}}})... trying again after delay
      javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
          at sun.security.ssl.AppOutputStream.write(Unknown Source)
          at java.io.OutputStream.write(Unknown Source)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:302)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:292)
          at com.notnoop.apns.internal.ApnsPooledConnection$2.run(ApnsPooledConnection.java:47)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
      
      [7/23/16 16:02:49:838 GST] 00000125 om.ibm.pushworks.server.notification.apns.ApnsConnectionImpl I Failed to send message Message(Id=1; Token=sgaskjgsdkahdsfgksadhfgksdhfgsakdjfhgasdkhfds; Payload={"payload":"{\"tag\":\"Push.ALL\"}","aps":{"alert":{"action-loc-key":null,"body":"مرحبا كيف حالك اليوم؟"}}})... trying again after delay
      javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
          at sun.security.ssl.AppOutputStream.write(Unknown Source)
          at java.io.OutputStream.write(Unknown Source)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:302)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:292)
          at com.notnoop.apns.internal.ApnsPooledConnection$2.run(ApnsPooledConnection.java:47)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
      
      [7/23/16 16:02:51:501 GST] 00000125 om.ibm.pushworks.server.notification.apns.ApnsConnectionImpl E Couldn't send message after 3 retries.Message(Id=1; Token=sgaskjgsdkahdsfgksadhfgksdhfgsakdjfhgasdkhfds; Payload={"payload":"{\"tag\":\"Push.ALL\"}","aps":{"alert":{"action-loc-key":null,"body":"مرحبا كيف حالك اليوم؟"}}})
      javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
          at sun.security.ssl.AppOutputStream.write(Unknown Source)
          at java.io.OutputStream.write(Unknown Source)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:302)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:292)
          at com.notnoop.apns.internal.ApnsPooledConnection$2.run(ApnsPooledConnection.java:47)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
      
      [7/23/16 16:02:51:501 GST] 00000125 ibm.pushworks.server.notification.apns.ApplicationConnection E FPWSE1083E: Failed to send APNS notification with identifier 1, device token: sgaskjgsdkahdsfgksadhfgksdhfgsakdjfhgasdkhfds
      javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
          at sun.security.ssl.AppOutputStream.write(Unknown Source)
          at java.io.OutputStream.write(Unknown Source)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:302)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:292)
          at com.notnoop.apns.internal.ApnsPooledConnection$2.run(ApnsPooledConnection.java:47)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
      
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R Exception in thread "pool-5-thread-1" 
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at com.notnoop.apns.internal.Utilities.wrapAndThrowAsRuntimeException(Utilities.java:277)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:319)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:292)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at com.notnoop.apns.internal.ApnsPooledConnection$2.run(ApnsPooledConnection.java:47)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at java.lang.Thread.run(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at sun.security.ssl.Alerts.getSSLException(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at sun.security.ssl.Alerts.getSSLException(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at sun.security.ssl.AppOutputStream.write(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at java.io.OutputStream.write(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:302)
      [7/23/16 16:02:51:516 GST] 00000125 SystemErr                                                    R  ... 5 more
      [7/23/16 16:02:51:516 GST] 00000126 om.ibm.pushworks.server.notification.apns.ApnsConnectionImpl E Couldn't send message after 3 retries.Message(Id=2; Token=sdfsadfsdfsdfsdfsdf; Payload={"payload":"{\"tag\":\"Push.ALL\"}","aps":{"alert":{"action-loc-key":null,"body":"مرحبا كيف حالك اليوم؟"}}})
      javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
          at sun.security.ssl.AppOutputStream.write(Unknown Source)
          at java.io.OutputStream.write(Unknown Source)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:302)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:292)
          at com.notnoop.apns.internal.ApnsPooledConnection$2.run(ApnsPooledConnection.java:47)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
      
      [7/23/16 16:02:51:516 GST] 00000126 ibm.pushworks.server.notification.apns.ApplicationConnection E FPWSE1083E: Failed to send APNS notification with identifier 2, device token: sdfsadfsdfsdfsdfsdf
      javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
          at sun.security.ssl.AppOutputStream.write(Unknown Source)
          at java.io.OutputStream.write(Unknown Source)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:302)
          at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:292)
          at com.notnoop.apns.internal.ApnsPooledConnection$2.run(ApnsPooledConnection.java:47)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
      
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R Exception in thread "pool-5-thread-2" 
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at com.notnoop.apns.internal.Utilities.wrapAndThrowAsRuntimeException(Utilities.java:277)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:319)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:292)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at com.notnoop.apns.internal.ApnsPooledConnection$2.run(ApnsPooledConnection.java:47)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at java.lang.Thread.run(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at sun.security.ssl.Alerts.getSSLException(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at sun.security.ssl.Alerts.getSSLException(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at sun.security.ssl.AppOutputStream.write(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at java.io.OutputStream.write(Unknown Source)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  at com.ibm.pushworks.server.notification.apns.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:302)
      [7/23/16 16:02:51:516 GST] 00000126 SystemErr                                                    R  ... 5 more
      

1 个答案:

答案 0 :(得分:0)

这通常是由于您的服务器安装在计算机之间的Java版本差异(dev vs prod)。例如:

如果并非所有端口都打开,也可能发生,例如反馈服务:

  • feedback.push.apple.com,端口2196 在端口2196上的feedback.sandbox.push.apple.com