swoole 配置 ssl 使用
问题描述
在 http
页面请求 websocket
,可以正常请求。但在 https
页面请求 websocket
却报下边这样的错误:
failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR
现场环境
websocket
服务端使用的 swoole
,编译时,也带上了 --enable-openssl
,执行 php --ri swoole
时,结果如下:
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.3.1
Built => Apr 1 2019 17:09:22
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 1.0.2k-fips 26 Jan 2017
http2 => enabled
pcre => enabled
zlib => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608
页面 js
请求也换成了 wss
,ssl
证书也添加了。请问有小伙伴遇到过这样的问题么。可有解决方法。谢谢。
推荐文章: