Using Charles and SSL Apple push address

给你一囗甜甜゛ 提交于 2019-12-05 19:59:32

This is because you passed a context with http options to stream_socket_client() - and more to the point you used an ssl:// wrapper instead of http:// or https://.

The stream_socket_*() functions do not know that you are implementing HTTP so they do not use the http context options - in order for this to work you would need to do e.g.

$fp = fopen('https://gateway.sandbox.push.apple.com:2195/path/to/file', 'r', false, $ctx);

This is probably a better idea anyway, because it is unlikely you would need the granular control that implementing HTTP manually would give you for the Apple APIs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!