Skip to content

Commit ef0fc42

Browse files
committed
Merge branch 'jk/httpd-test-updates'
Test update. * jk/httpd-test-updates: t/lib-httpd: increase ssl key size to 2048 bits t/lib-httpd: drop SSLMutex config t/lib-httpd: bump required apache version to 2.4 t/lib-httpd: bump required apache version to 2.2 This is a backport onto the `maint-2.39` branch, to improve the CI health of that branch. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents e3cbeb9 + b08edf7 commit ef0fc42

File tree

3 files changed

+12
-32
lines changed

3 files changed

+12
-32
lines changed

t/lib-httpd.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,19 @@ then
9999
fi
100100

101101
HTTPD_VERSION=$($LIB_HTTPD_PATH -v | \
102-
sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q')
102+
sed -n 's/^Server version: Apache\/\([0-9.]*\).*$/\1/p; q')
103+
HTTPD_VERSION_MAJOR=$(echo $HTTPD_VERSION | cut -d. -f1)
104+
HTTPD_VERSION_MINOR=$(echo $HTTPD_VERSION | cut -d. -f2)
103105

104-
if test -n "$HTTPD_VERSION"
106+
if test -n "$HTTPD_VERSION_MAJOR"
105107
then
106108
if test -z "$LIB_HTTPD_MODULE_PATH"
107109
then
108-
if ! test $HTTPD_VERSION -ge 2
110+
if ! test "$HTTPD_VERSION_MAJOR" -eq 2 ||
111+
! test "$HTTPD_VERSION_MINOR" -ge 4
109112
then
110113
test_skip_or_die GIT_TEST_HTTPD \
111-
"at least Apache version 2 is required"
114+
"at least Apache version 2.4 is required"
112115
fi
113116
if ! test -d "$DEFAULT_HTTPD_MODULE_PATH"
114117
then

t/lib-httpd/apache.conf

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,6 @@ LoadModule http2_module modules/mod_http2.so
3434
Protocols h2 h2c
3535
</IfDefine>
3636

37-
<IfVersion < 2.4>
38-
LockFile accept.lock
39-
</IfVersion>
40-
41-
<IfVersion < 2.1>
42-
<IfModule !mod_auth.c>
43-
LoadModule auth_module modules/mod_auth.so
44-
</IfModule>
45-
</IfVersion>
46-
47-
<IfVersion >= 2.1>
4837
<IfModule !mod_auth_basic.c>
4938
LoadModule auth_basic_module modules/mod_auth_basic.so
5039
</IfModule>
@@ -57,9 +46,7 @@ LockFile accept.lock
5746
<IfModule !mod_authz_host.c>
5847
LoadModule authz_host_module modules/mod_authz_host.so
5948
</IfModule>
60-
</IfVersion>
6149

62-
<IfVersion >= 2.4>
6350
<IfModule !mod_authn_core.c>
6451
LoadModule authn_core_module modules/mod_authn_core.so
6552
</IfModule>
@@ -83,7 +70,6 @@ LockFile accept.lock
8370
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
8471
</IfModule>
8572
</IfDefine>
86-
</IfVersion>
8773

8874
PassEnv GIT_VALGRIND
8975
PassEnv GIT_VALGRIND_OPTIONS
@@ -123,6 +109,10 @@ Alias /auth/dumb/ www/auth/dumb/
123109
Header set Set-Cookie name=value
124110
</LocationMatch>
125111
<LocationMatch /smart_headers/>
112+
<RequireAll>
113+
Require expr %{HTTP:x-magic-one} == 'abra'
114+
Require expr %{HTTP:x-magic-two} == 'cadabra'
115+
</RequireAll>
126116
SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
127117
SetEnv GIT_HTTP_EXPORT_ALL
128118
</LocationMatch>
@@ -205,18 +195,6 @@ RewriteRule ^/intern-redir/(.*)/foo$ /smart/$1 [PT]
205195
RewriteRule ^/redir-objects/(.*/info/refs)$ /dumb/$1 [PT]
206196
RewriteRule ^/redir-objects/(.*/objects/.*)$ /dumb/$1 [R=301]
207197

208-
# Apache 2.2 does not understand <RequireAll>, so we use RewriteCond.
209-
# And as RewriteCond does not allow testing for non-matches, we match
210-
# the desired case first (one has abra, two has cadabra), and let it
211-
# pass by marking the RewriteRule as [L], "last rule, do not process
212-
# any other matching RewriteRules after this"), and then have another
213-
# RewriteRule that matches all other cases and lets them fail via '[F]',
214-
# "fail the request".
215-
RewriteCond %{HTTP:x-magic-one} =abra
216-
RewriteCond %{HTTP:x-magic-two} =cadabra
217-
RewriteRule ^/smart_headers/.* - [L]
218-
RewriteRule ^/smart_headers/.* - [F]
219-
220198
<IfDefine SSL>
221199
LoadModule ssl_module modules/mod_ssl.so
222200

@@ -225,7 +203,6 @@ SSLCertificateKeyFile httpd.pem
225203
SSLRandomSeed startup file:/dev/urandom 512
226204
SSLRandomSeed connect file:/dev/urandom 512
227205
SSLSessionCache none
228-
SSLMutex file:ssl_mutex
229206
SSLEngine On
230207
</IfDefine>
231208

t/lib-httpd/ssl.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
RANDFILE = $ENV::RANDFILE_PATH
22

33
[ req ]
4-
default_bits = 1024
4+
default_bits = 2048
55
distinguished_name = req_distinguished_name
66
prompt = no
77
[ req_distinguished_name ]

0 commit comments

Comments
 (0)