push推送相关注意事项

时间:2022-12-20 23:58:00

1.curl的问题
配置https的证书http://blog.csdn.net/weixin_35884835/article/details/52588157

2.ios push 针对http1.0的,需要服务器开通2195这个端口

3.nodejs报下面的错误 是证书过期了

 2017-02-15 08:07:03 16621>>>>>>> Socket undefined error occurred:Error: socket hang up
2017-02-15 08:07:03 16621<<<<<<< TypeError: Cannot read property 'length' of undefined

4.抓包

tcpdump tcp port 443 -i any -Xs 1024 -nn
tcpdump tcp port 80 -i any -As 0 -nn
netstat -nap 判断哪个端口被调用

5.华为的push是要像华为申请一个access_token的 然后更改证书的的时候需要同步删除之前保存的access_token

{"message":"No permission to send message to these tmIDs.","requestID":"14900642050202330435","resultcode":20203}

出现这个错误是device token错误的原因导致的
可能是调试期间 access_token没有随着证书的变化而变化

6.忽略https的证书 加上 -k这个参数,下面这个报错就是需要证书验证,可以忽略

[root@localhost ~]# curl https://ip/index.php
curl: (60) Peer's Certificate has expired.
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn'
t adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.

curl命令忽略

curl https://ip -k

yii2 处理忽略https证书

$response = $curl->reset()->setOption(
CURLOPT_POSTFIELDS,
http_build_query($data_array)
)->setOption(CURLOPT_SSL_VERIFYPEER, false)->post($url);