Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all articles
Browse latest Browse all 12749

[原]基于 HTTP/2 的 APNs 协议:Universal Push Notification Client SSL 证书

$
0
0

前久生产用的 Push 证书过期,于是重新制作了证书放到服务器上。原本以为这就 OK 了。

但今天测试时发现,在仿真服务器上的沙盒证书不能用了!(用 APN Tester Free 测试)。

google 了一下发现:

2015年12月17日起,发布 “基于 HTTP/2 的全新 APNs 协议”,新版 APNs 协议做了如下改变:

Request 和 Response 支持JSON网络协议 APNs支持状态码和返回 error 信息 APNs推送成功时 Response 将返回状态码200,远程通知是否发送成功再也不用靠猜了! APNs推送失败时,Response 将返回 JSON 格式的 Error 信息。 最大推送长度提升到4096字节(4Kb) 可以通过 “HTTP/2 PING ” 心跳包功能检测当前 APNs 连接是否可用,并能维持当前长连接。 支持为不同的推送类型定义 “topic” 主题 不同推送类型,只需要一种推送证书 Universal Push Notification Client SSL 证书。

显然问题出现在最后一条上。原来的生产证书的名字叫做 “Apple Producton IOS Push Service”,开发证书的名字叫做 “Apple Productoin IOS Push Service”.

现在则统一叫做 Apple Push Services 了(也就是制作证书时的“Apple Push Notification service SSL (Sandbox & Production)选项”):


[原]基于 HTTP/2 的 APNs 协议:Universal Push Notification Client SSL 证书

也就是说,不管是发布模式、还是调试模式下都使用同一个证书。

但同时,沙盒版本的 APNs 服务器地址也删除了,现在统一连接生产的 APNs 服务器进行发送:


[原]基于 HTTP/2 的 APNs 协议:Universal Push Notification Client SSL 证书

图中,笔者用 Easy Apns Provider 测试了一条消息,使用的是 Universal Push Notification Client SSL 证书,服务器连接的也是 gateway.push.apple.com,手机上上安装的 App 是 debug 版本,最后消息仍然推送成功。


Viewing all articles
Browse latest Browse all 12749

Latest Images

Trending Articles





Latest Images