关于websocket的ssl问题

再https下 用wss连接swoole的webscoket服务器 握手失败 服务端报错

[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/reactor/ReactorPoll.c:245@swReactorPoll_wait]Event: fd=18|from_id=2|type=11
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/reactor/ReactorPoll.c:245@swReactorPoll_wait]Event: fd=19|from_id=2|type=1
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/network/Server.c:131@swServer_master_onAccept][Master] Accept new connection. maxfd=22|reactor_id=2|conn=23
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/reactor/ReactorPoll.c:245@swReactorPoll_wait]Event: fd=18|from_id=2|type=11
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/reactor/ReactorPoll.c:245@swReactorPoll_wait]Event: fd=19|from_id=2|type=1
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/network/Server.c:131@swServer_master_onAccept][Master] Accept new connection. maxfd=23|reactor_id=2|conn=24
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/factory/FactoryProcess.c:245@swFactoryProcess_finish][Worker] send: sendn=12|type=4|content=(null)
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/network/ReactorThread.c:289@swReactorThread_close]Close Event.fd=23|from=1
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/factory/FactoryProcess.c:245@swFactoryProcess_finish][Worker] send: sendn=12|type=4|content=(null)
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/network/ReactorThread.c:289@swReactorThread_close]Close Event.fd=24|from=0
[/www/software/swoole/swoole-src-swoole-1.7.22-stable/src/network/ReactorThread.c:355@swReactorThread_close]set_maxfd=23|close_fd=24

web端报错

WebSocket connection to 'wss://{}' failed: Error in connection establishment: net::ERR_TIMED_OUT

确定是在https发起的连接 下 确定swoole编译加入了open-ssl 确认连接的wss 证书配置

            'ssl_cert_file' => WEBPATH . '/ssl_key/server.crt',
            'ssl_key_file' => WEBPATH . '/ssl_key/server.key',

这书是证书签发商给我的 给的是pem 但是 那边说直接把pem改成crt就可以用 所以这个server.crt 实际是 server.pem改名的 求问 还有可能是什么问题啊

2016-01-14 23:46
0
0

韩天峰 - 关注外星人

赞同来自:

wss://{} 这个很奇怪,完全没有IP和PORT

2016-01-18 07:37
0

lm489155 - 80后it男

赞同来自:

请问上述问题后来是怎么解决的呢?可否说明一下,谢谢!目前遇到了类似的问题,提示“WebSocket connection to 'wss://...' failed: WebSocket opening handshake timed out”!

2017-05-05 17:06

要回复问题请先登录注册