PHP Warning: stream_socket_client(): Peer certificate *_**_ did not match expected ***** in /home/workerman/vendor/workerman/workerman/Connection/AsyncTcpConnection.php on line 172
PHP Warning: stream_socket_client(): Failed to enable crypto in /home/workerman/vendor/workerman/workerman/Connection/AsyncTcpConnection.php on line 172
不好意思,漏看文档
直接ws
外面套一层ssl就可以了。
$ws_connection->transport = 'ssl';
3q
还是有问题
用另一个workerman作为客户端去链接,连是能连上,但,死活无法接收和发送任何消息
在chrome的控制台测试链接是没问题的
另外还有个现象
在客户端的workerman处于已连接状态时,重启服务端,客户端workerman重连会报错
PHP Warning: stream_socket_client(): Peer certificate *_**_ did not match expected ***** in /home/workerman/vendor/workerman/workerman/Connection/AsyncTcpConnection.php on line 172
PHP Warning: stream_socket_client(): Failed to enable crypto in /home/workerman/vendor/workerman/workerman/Connection/AsyncTcpConnection.php on line 172
证书这一段我就隐去了。证书是买的哦,不是自签的。
客户端workerman这样设置后,重连时倒是不会报上面的错了。
new AsyncTcpConnection 的时候传进去
$context = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
)
);
但是两个workerman之间还是存在无法收发消息的问题。完全没动静
这个问题已经修复,请重新下载。
workerman版本 3.4.1