summaryrefslogtreecommitdiffstats
path: root/tests/ocsp-stapling.sh
blob: 8ce1fa80bcb3d0cafea40f9e1b9efd0c2852e0d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# OCSP stapling test (requires strace)
#
# Copyright (C) 2019  Patrick McDermott
#
# This file is part of wolfssl-util.
#
# wolfssl-util 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 2 of the License, or
# (at your option) any later version.
#
# wolfssl-util 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 wolfssl-util.  If not, see <http://www.gnu.org/licenses/>.

set -eu

. "${TOP_SRCDIR}/tests/aux/tap-functions.sh"

plan_ 1

if printf 'HEAD / HTTP/1.1\r\nHost: letsencrypt.org:443\r\n'$(: \
		)'Connection: close\r\n\r\n' | strace -f -e trace=network \
		"${TOP_BUILDDIR}/wolfssl-util" s_client \
		-connect letsencrypt.org:443 \
		-servername letsencrypt.org 2>&1 | \
		grep -F 'sin_port=htons(80)'; then
	result='not ok'
else
	result='ok'
fi
printf '\n'
result_ "${result}" -- 'OCSP stapling'