首页
下载
文档
问答社区
视频
捐赠
源代码
AI 助理
赞助商
CRMEB
Apipost
腾讯云
微擎
禅道
51Talk
商业产品
Swoole AI 智能文档翻译器
Swoole-Compiler PHP 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
http_autoindex参数导致启用ssl时功能异常
### 配置下面参数后, 同时开启ssl时, 导致直接列出了静态文件目录; 如果再同时开启http2, 则会触发下载 ``` swoole Swoole => enabled Author => Swoole Team <team@swoole.com> Version => 4.5.1 Built => May 11 2020 21:22:37 coroutine => enabled epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled sockets => enabled openssl => OpenSSL 1.1.1d 10 Sep 2019 http2 => enabled zlib => 1.2.11 mutex_timedlock => enabled pthread_barrier => enabled futex => enabled mysqlnd => 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 ``` #### 全部代码 (需要ssl证书) ``` $sslDir = __DIR__ . "/../../ssl/"; $http = new Swoole\Http\Server("0.0.0.0", 443, SWOOLE_PROCESS, SWOOLE_SOCK_TCP | SWOOLE_SSL); $http->set([ 'document_root' => __DIR__, 'enable_static_handler' => true, 'http_autoindex' => true, 'http_index_files' => ['indes.html'], 'ssl_cert_file' => $sslDir . 'server.crt', 'ssl_key_file' => $sslDir . 'server.key', // 'open_http2_protocol' => true, ]); $http->on('request', function ($request, $response) { var_dump($request); $response->end("<h1>Hello Swoole. #".rand(1000, 9999)."</h1>"); }); echo "Http Server was started !"; $http->start(); ``` ### 希望正常输出hello world! ##### 但这是仅开启ssl的效果 ![](/storage/article-column/XHkkbHr7Qt6KjfxV43rPEux42zb1n2ynUB4VWzQZ.png) ##### 这是同时开启http2后的效果 ![](/storage/article-column/A5zNnBlLR2cG21jBGI6BK2QKuz2HXbtCInmGB6ob.png)
发布于4年前 · 0 次浏览 · 来自
提问
Drunk
### 配置下面参数后, 同时开启ssl时, 导致直接列出了静态文件目录; 如果再同时开启http2, 则会触发下载 ``` swoole Swoole => enabled Author => Swoole Team <team@swoole.com> Version => 4.5.1 Built => May 11 2020 21:22:37 coroutine => enabled epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled sockets => enabled openssl => OpenSSL 1.1.1d 10 Sep 2019 http2 => enabled zlib => 1.2.11 mutex_timedlock => enabled pthread_barrier => enabled futex => enabled mysqlnd => 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 ``` #### 全部代码 (需要ssl证书) ``` $sslDir = __DIR__ . "/../../ssl/"; $http = new Swoole\Http\Server("0.0.0.0", 443, SWOOLE_PROCESS, SWOOLE_SOCK_TCP | SWOOLE_SSL); $http->set([ 'document_root' => __DIR__, 'enable_static_handler' => true, 'http_autoindex' => true, 'http_index_files' => ['indes.html'], 'ssl_cert_file' => $sslDir . 'server.crt', 'ssl_key_file' => $sslDir . 'server.key', // 'open_http2_protocol' => true, ]); $http->on('request', function ($request, $response) { var_dump($request); $response->end("<h1>Hello Swoole. #".rand(1000, 9999)."</h1>"); }); echo "Http Server was started !"; $http->start(); ``` ### 希望正常输出hello world! ##### 但这是仅开启ssl的效果 ![](/storage/article-column/XHkkbHr7Qt6KjfxV43rPEux42zb1n2ynUB4VWzQZ.png) ##### 这是同时开启http2后的效果 ![](/storage/article-column/A5zNnBlLR2cG21jBGI6BK2QKuz2HXbtCInmGB6ob.png)
赞
0
分享
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
评论
2020-05-13
郭新华
这应该是个bug 我们看看
赞
1
回复
2020-05-19
Drunk
回复
郭新华
好的
赞
0
回复
微信公众号
热门内容
作者其它话题
- Channel实现的协程版TcpClient连接池无法复用
暂无回复的问答
- CodeGalaxy K3s 轻量集群节点之间如何实现负载均衡
- 关于openssl CURL WARNING swSSL_connect: SSL_connect(fd=69) failed. Error: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small[1|394]
- 多个模型如何进行事务异常回退?
- websocket开启wss报错
- 协程tcp服务器如何使用多进程?recv()方法接收信息,打印出来的pid一直是同一个。没用使用到多进程啊。