将http改成https后出错,原来在http中没问题的,现在改成https后,浏览器提示:98:261 WebSocket connection to 'wss://www.xsdancer.com:8282/' failed: Error in connection establishment: net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH
代码:
$context = array(
'ssl' => array(
'local_cert' => '/www/server/panel/vhost/ssl/fullchain.pem', // 或者crt文件
'local_pk' => '/www/server/panel/vhost/ssl/privkey.pem',
'verify_peer' => false
)
);
// gateway 进程,这里使用Text协议,可以用telnet测试
//$gateway = new Gateway("websocket://0.0.0.0:8282");
$gateway = new Gateway("websocket://0.0.0.0:8282",$context);//ssl方式
$gateway->transport = 'ssl';// 开启SSL,websocket+SSL 即wss
debug方式运行,看下服务端报错
debug方式运行了,浏览器连接的时候没有任何提示,只有浏览器提示:WebSocket connection to 'wss://xsdancer.com:8282/' failed: Error in connection establishment: net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH