首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
报:reason=1042, error_string=sslv3 alert bad certificate | reason=108, error_string=bad key share 等问题
### 问题描述 ``` [2023-04-12 06:21:52 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:51358], reason=396, error_string=version too low [2023-04-12 06:22:21 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:62190], reason=193, error_string=no shared cipher [2023-04-12 06:23:09 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:55844], reason=193, error_string=no shared cipher [2023-04-12 06:23:09 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:55858], reason=258, error_string=unsupported protocol [2023-04-12 06:23:10 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:55882], reason=193, error_string=no shared cipher [2023-04-12 06:23:10 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:55888], reason=108, error_string=bad key share [2023-04-12 06:34:02 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[141.95.205.46:49034], reason=1042, error_string=sslv3 alert bad certificate ```  ### Swoole版本,PHP版本,以及操作系统版本信息 PHP版本 ``` ~# php -v PHP 8.1.17 (cli) (built: Mar 16 2023 14:38:17) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.17, Copyright (c) Zend Technologies with Zend OPcache v8.1.17, Copyright (c), by Zend Technologies ``` Swoole版本 ``` ~# php --ri swoole swoole Swoole => enabled Author => Swoole Team <team@swoole.com> Version => 5.0.2 Built => Mar 28 2023 14:40:52 coroutine => enabled with boost asm context epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled openssl => OpenSSL 1.1.1f 31 Mar 2020 dtls => enabled http2 => enabled json => enabled zlib => 1.2.11 mutex_timedlock => enabled pthread_barrier => enabled futex => enabled async_redis => enabled Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.enable_library => On => On swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => On => On swoole.unixsock_buffer_size => 8388608 => 8388608 ``` 操作系统版本信息 ``` ~# uname -a Linux alpha-6f9f303196 5.4.0 #1 SMP Tue Jan 25 12:49:12 MSK 2022 x86_64 x86_64 x86_64 GNU/Linux ``` ``` ~# cat /proc/version Linux version 5.4.0 (mockbuild@builder9.eng.sw.ru) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Jan 25 12:49:12 MSK 2022 ``` ``` ~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal ``` ### 相关代码 ```php 请将代码粘贴至此处(请勿用截图) ``` ### 你期待的结果是什么?实际看到的错误信息又是什么?
发布于3年前 · 10 次浏览 · 来自
提问
Scort
### 问题描述 ``` [2023-04-12 06:21:52 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:51358], reason=396, error_string=version too low [2023-04-12 06:22:21 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:62190], reason=193, error_string=no shared cipher [2023-04-12 06:23:09 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:55844], reason=193, error_string=no shared cipher [2023-04-12 06:23:09 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:55858], reason=258, error_string=unsupported protocol [2023-04-12 06:23:10 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:55882], reason=193, error_string=no shared cipher [2023-04-12 06:23:10 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[74.82.47.3:55888], reason=108, error_string=bad key share [2023-04-12 06:34:02 #674623.1] WARNING Socket::ssl_accept(): bad SSL client[141.95.205.46:49034], reason=1042, error_string=sslv3 alert bad certificate ```  ### Swoole版本,PHP版本,以及操作系统版本信息 PHP版本 ``` ~# php -v PHP 8.1.17 (cli) (built: Mar 16 2023 14:38:17) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.17, Copyright (c) Zend Technologies with Zend OPcache v8.1.17, Copyright (c), by Zend Technologies ``` Swoole版本 ``` ~# php --ri swoole swoole Swoole => enabled Author => Swoole Team <team@swoole.com> Version => 5.0.2 Built => Mar 28 2023 14:40:52 coroutine => enabled with boost asm context epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled openssl => OpenSSL 1.1.1f 31 Mar 2020 dtls => enabled http2 => enabled json => enabled zlib => 1.2.11 mutex_timedlock => enabled pthread_barrier => enabled futex => enabled async_redis => enabled Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.enable_library => On => On swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => On => On swoole.unixsock_buffer_size => 8388608 => 8388608 ``` 操作系统版本信息 ``` ~# uname -a Linux alpha-6f9f303196 5.4.0 #1 SMP Tue Jan 25 12:49:12 MSK 2022 x86_64 x86_64 x86_64 GNU/Linux ``` ``` ~# cat /proc/version Linux version 5.4.0 (mockbuild@builder9.eng.sw.ru) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Jan 25 12:49:12 MSK 2022 ``` ``` ~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal ``` ### 相关代码 ```php 请将代码粘贴至此处(请勿用截图) ``` ### 你期待的结果是什么?实际看到的错误信息又是什么?
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2023-04-13
Scort
使用swoole创建WebSocket服务端,并支持wss,以下是使用到的相关代码: ````php //创建WebSocket Server对象,监听0.0.0.0:9502端口。 $ws = new Swoole\WebSocket\Server('0.0.0.0', 443, SWOOLE_PROCESS, SWOOLE_SOCK_TCP | SWOOLE_SSL); $ws->set( [ 'ssl_cert_file' => __DIR__ . '/cert/MY_CERT.crt', 'ssl_key_file' => __DIR__ . '/cert/MY_CERT.key', ] ); //监听WebSocket连接打开事件。 $ws->on('Open', function ($ws, $request) { $id = $request->fd; $wsKey = 'ws_' . $id; $tid = Swoole\Timer::after(1000, function () use ($ws, $id, $wsKey) { $tid = !empty($ws->$wsKey) ? $ws->$wsKey->tid : 0; echo "Hi, $id. After 1's not sign disconnected ~{$tid}\n"; if ($ws->isEstablished($id)) $ws->disconnect($id); }); $ws->$wsKey = json_decode(json_encode(['tid' => $tid])); $v = json_encode($ws->$wsKey); echo "Hello, $id. please in 1's sign ~{$tid}[{$wsKey} => {$v}]\n"; }); ... ````
赞
0
回复
2023-04-13
Scort
客户端使用的微信小程序接口: https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.connectSocket.html
赞
0
回复
2023-04-21
Rango
这说明有非 `SSL` 的请求 或者 `SSL` 版本过低不支持,建议同时监听 `80` 和 `443` - `80` : `ws` 非加密 - `443`:`wss` 加密
赞
0
回复