// 證書(shū)最好是申請(qǐng)的證書(shū)
$context = array(
// 更多ssl選項(xiàng)請(qǐng)參考手冊(cè) https://php.net/manual/zh/context.ssl.php
'ssl' => array(
// 請(qǐng)使用絕對(duì)路徑
'local_cert' => '磁盤(pán)路徑/server.pem', // 也可以是crt文件
'local_pk' => '磁盤(pán)路徑/server.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:443", $context);
iis服務(wù)器 只有pfx證書(shū) local_cert local_pk選項(xiàng)就沒(méi)用了