// 證書最好是申請的證書
$context = array(
// 更多ssl選項請參考手冊 https://php.net/manual/zh/context.ssl.php
'ssl' => array(
// 請使用絕對路徑
'local_cert' => '磁盤路徑/server.pem', // 也可以是crt文件
'local_pk' => '磁盤路徑/server.key',
'verify_peer' => false,
// 'allow_self_signed' => true, //如果是自簽名證書需要開啟此選項
)
);
// websocket協(xié)議(端口任意,只要沒有被其它程序占用就行)
$gateway = new Gateway("websocket://0.0.0.0:443", $context);
iis服務(wù)器 只有pfx證書 local_cert local_pk選項就沒用了