1
0
mirror of https://github.com/graygnuorg/pound.git synced 2026-10-25 10:19:36 +03:00
Files
pound/tests/https.at
Sergey Poznyakoff 24a654bc28 Revise header modification directives.
* src/config.c (POUND_DEFAULTS): New field: header_options.
(parse_header_options): New function.
(listener_alloc): Initialize header_options.
(http_parsetab, https_parsetab, top_level_parsetab): New directive:
HeaderOption.
* src/http.c (http_header_list_locate_name): New function.
(http_header_list_append): Check if the header being added is already
in the list.  If so, act as instructed by the "replace" argument.
(http_header_list_append_list): Likewise.
(add_forwarded_headers): New function.
(do_http): Apply all header modifications after having selected the
service.  First, canned headers are added, then user-defined headers
added, then header removal directives are applied.
* src/pound.h (http_header_list_append): Change signature.  All uses
changed.

* tests/Makefile.am: Add new tests.
* tests/https.at: Remove unnecessary ClientCert directive.
* tests/optfwd.at: New test.
* tests/optorder.at: New test.
* tests/optssl.at: New test.
* tests/poundharness.pl: New variable expansions: LISTENER:PORT and
LISTENER:IP.  Same for BACKEND.
* tests/testsuite.at: Include new tests.

* NEWS: Document changes.
* doc/pound.8: Document changes.
* configure.ac: Version 4.3.90
2023-01-18 12:40:33 +02:00

52 lines
1.2 KiB
Plaintext

# This file is part of pound testsuite. -*- autotest -*-
# Copyright (C) 2022-2023 Sergey Poznyakoff
#
# Pound is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Pound is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pound. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([HTTPS listener])
AT_KEYWORDS([https])
AT_CHECK([openssl req -new -newkey rsa:2048 -days 1 -nodes -x509 \
-subj "/CN=www.example.com" -keyout key.pem -out crt.pem || exit 77
cat crt.pem key.pem > example.pem
],
[0],
[ignore],
[ignore])
PT_CHECK(
[Service
Backend
Address 127.0.0.1
Port 8081
End
End
ListenHTTPS
Address 127.0.0.1
Port 8080
Cert "example.pem"
End
],
[GET /echo/foo/bar
Host: www.example.com
end
200
x-orig-uri: /echo/foo/bar
x-orig-header-x-ssl-cipher: /TLSv1\./
end
])
AT_CLEANUP