版本:Apache/2.4.10 (Raspbian) PHP/5.6.30-0+deb8u1 OpenSSL/1.0.1t
从 Linux 控制台测试 SSL 超时:
time openssl s_client -connect x.y.z:443
...
Start Time: 1504204638
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
(delay of about 20 secs)
----
read:errno=0
real 0m20.903s
user 0m0.050s
sys 0m0.000s
完成上述测试后,显示错误日志(在调试级别设置中)
[2017-08-31 12:00:46] [ssl:info] [client 192.168.1.1:38094] AH01964: Connection to child 0 established (server x.y.z:443)
[2017-08-31 12:00:46] [ssl:debug] ssl_engine_kernel.c(1936): [client 192.168.1.1:38094] AH02645: Server name not provided via TLS extension (using default/first virtual host)
[2017-08-31 12:00:46] [ssl:debug] ssl_engine_kernel.c(1841): [client 192.168.1.1:38094] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
(请注意 21 秒的延迟(显然 openssl 有 20 秒的硬编码延迟))
[2017-08-31 12:01:07] [reqtimeout:info] [client 192.168.1.1:38094] AH01382: Request header read timeout
[2017-08-31 12:01:07] [ssl:info] (70007)The timeout specified has expired: [client 192.168.1.1:38094] AH01991: SSL input filter read failed.
[2017-08-31 12:01:07] [ssl:debug] ssl_engine_io.c(1004): [client 192.168.1.1:38094] AH02001: Connection closed to child 0 with standard shutdown (server x.y.z:443)
图像上传,即使是小文件,也会在大约 15 秒后超时,与以下内容无关(请参阅尝试的两种设置)
# the following is an expt, setting very low to see if this statement has any effect at all. We get time out after 15 secs, for any setting.
#RequestReadTimeout header=5 body=9
RequestReadTimeout header=60-100,MinRate=50 body=80,MinRate=50
对于 apache 2.4 error.log 中超时期间的实际超时(无论使用上述哪种设置,超时时间几乎都是相同的 15 秒;下面仅显示一个日志)
[2017-08-31 12:06:52] [authz_core:debug] mod_authz_core.c(809): [client 192.168.1.1:52406] AH01626: authorization result of <RequireAny>: granted, referer ...
(注意授权已授予。高于/低于之间延迟约 15 秒!)
[2017-08-31 12:07:07] [reqtimeout:info] [client 192.168.1.1:52406] AH01382: Request header read timeout
[2017-08-31 12:07:07] [ssl:info] (70007)The timeout specified has expired: [client 192.168.1.1:52406] AH01991: SSL input filter read failed.
[2017-08-31 12:07:07] [ssl:debug] ssl_engine_io.c(1004): [client 192.168.1.1:52406] AH02001: Connection closed to child 2 with standardshutdown (server x.y.z:443)