source: mod_gnutls/test/test-26_redirect_HTTP_to_HTTPS.bash @ b47dc70

debian/master
Last change on this file since b47dc70 was e9e89b4, checked in by Fiona Klute <fiona.klute@…>, 19 months ago

Clean up outdated comment/naming in test-26_redirect_HTTP_to_HTTPS.bash

  • Property mode set to 100755
File size: 1.2 KB
RevLine 
[8ac7c0d]1#!/bin/bash
2#
3# This test checks if mod_rewrite rules can detect HTTPS connections
4# with "%{HTTPS}".
5
6set -e
7: ${srcdir:="."}
8. ${srcdir}/common.bash
9netns_reexec ${@}
10
[7c0ccaf]11testdir="${srcdir}/tests/26_redirect_HTTP_to_HTTPS"
[8ac7c0d]12TEST_NAME="$(basename ${testdir})"
[1872744]13. $(dirname ${0})/apache_service.bash
[8ac7c0d]14
15: ${TEST_HTTP_PORT:="9935"}
16export TEST_HTTP_PORT
17
[e9e89b4]18function stop_server
[8ac7c0d]19{
[1872744]20    apache_service "${testdir}" "apache.conf" stop
[8ac7c0d]21}
[1872744]22apache_service "${testdir}" "apache.conf" start "${TEST_LOCK}"
[e9e89b4]23trap stop_server EXIT
[8ac7c0d]24
25output="outputs/${TEST_NAME}.output"
26rm -f "$output"
27
28# Send status request over HTTP. This should get redirected to HTTPS.
[67f2f58]29URL="http://${TEST_HOST}:${TEST_HTTP_PORT}/status?auto"
30if [ "$(basename ${HTTP_CLI})" = "curl" ]; then
[d84f0f7]31    ${HTTP_CLI} --location --verbose --cacert authority/x509.pem "${URL}" \
32                >"${output}"
[67f2f58]33elif [ "$(basename ${HTTP_CLI})" = "wget" ]; then
34    ${HTTP_CLI} --ca-certificate=authority/x509.pem -O "${output}" "${URL}"
35else
36    echo "No HTTP client (curl or wget) found, skipping." 2>&1
37    exit 77
38fi
[8ac7c0d]39
40# If the request was redirected correctly, the status report lists the
41# used ciphersuite.
42grep "Current TLS session: (TLS" "${output}"
43
[e9e89b4]44stop_server
[8ac7c0d]45trap - EXIT
Note: See TracBrowser for help on using the repository browser.