1 /*
2 * Copyright (c) 2018-2021 Free Software Foundation, Inc.
3 *
4 * This file is part of Wget
5 *
6 * Wget is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Wget is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Wget If not, see <https://www.gnu.org/licenses/>.
18 */
19
20 #include <config.h>
21
22 #include "libtest.h"
23
main(void)24 int main(void)
25 {
26 wget_test_url_t urls[]={
27 { .name = "/index.html",
28 .code = "200",
29 .body = "...",
30 .headers = {
31 "Content-Type: text/plain",
32 }
33 }
34 };
35
36 wget_test_start_server(
37 WGET_TEST_RESPONSE_URLS, &urls, countof(urls),
38 WGET_TEST_FEATURE_MHD,
39 WGET_TEST_FEATURE_TLS,
40 WGET_TEST_FEATURE_OCSP_STAPLING,
41 0);
42
43 // Test ocsp with 'verified' response
44 wget_test(
45 WGET_TEST_OPTIONS, "--ca-certificate=" SRCDIR "/certs/ocsp/x509-root-cert.pem --ocsp-stapling --no-ocsp-date",
46 WGET_TEST_REQUEST_URL, "https://localhost:{{sslport}}/index.html",
47 WGET_TEST_EXPECTED_ERROR_CODE, 0,
48 WGET_TEST_EXPECTED_FILES, &(wget_test_file_t []){
49 {urls[0].name + 1, urls[0].body},
50 { NULL} },
51 0);
52
53 exit(EXIT_SUCCESS);
54 }
55