websocket啟動(dòng)后報(bào)錯(cuò)
// 證書(shū)最好是申請(qǐng)的證書(shū)
$context = array(
// 更多ssl選項(xiàng)請(qǐng)參考手冊(cè) http://php.net/manual/zh/context.ssl.php
'ssl' => array(
// 請(qǐng)使用絕對(duì)路徑
'local_cert' => '/home/elinkSSL/wxwss.iloveismarthome.com/wxwss.pem', // 也可以是crt文件
'local_pk' => '/home/elinkSSL/wxwss.iloveismarthome.com/wxwss.key',
'verify_peer' => false,
// 'allow_self_signed' => true, //如果是自簽名證書(shū)需要開(kāi)啟此選項(xiàng)
)
);
// websocket協(xié)議(端口任意,只要沒(méi)有被其它程序占用就行)
$gateway = new Gateway("websocket://0.0.0.0:8871",$context);
// 開(kāi)啟SSL,websocket+SSL 即wss
$gateway->transport = 'ssl';
ssl root wss-lock-prod websocket://0.0.0.0:8871 10 [OK]
-------------------------------------------------------------------------------------------------------
Press Ctrl+C to stop. Start success.
SSL handshake error: stream_socket_enable_crypto(): SSL: Success
SSL handshake error: stream_socket_enable_crypto(): SSL: Success
SSL handshake error: stream_socket_enable_crypto(): SSL: Success
SSL handshake error: stream_socket_enable_crypto(): SSL: Success
workerman v 3.5.29 php 7.2.34