diff options
Diffstat (limited to 'src/testcurl/https/test_tls_authentication.c')
-rw-r--r-- | src/testcurl/https/test_tls_authentication.c | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/src/testcurl/https/test_tls_authentication.c b/src/testcurl/https/test_tls_authentication.c index 51c87c0e..5637eaaf 100644 --- a/src/testcurl/https/test_tls_authentication.c +++ b/src/testcurl/https/test_tls_authentication.c | |||
@@ -42,7 +42,7 @@ | |||
42 | static unsigned int | 42 | static unsigned int |
43 | test_secure_get (void *cls, const char *cipher_suite, int proto_version) | 43 | test_secure_get (void *cls, const char *cipher_suite, int proto_version) |
44 | { | 44 | { |
45 | unsigned int ret; | 45 | enum test_get_result ret; |
46 | struct MHD_Daemon *d; | 46 | struct MHD_Daemon *d; |
47 | uint16_t port; | 47 | uint16_t port; |
48 | (void) cls; /* Unused. Silent compiler warning. */ | 48 | (void) cls; /* Unused. Silent compiler warning. */ |
@@ -80,14 +80,28 @@ test_secure_get (void *cls, const char *cipher_suite, int proto_version) | |||
80 | ret = test_daemon_get (NULL, cipher_suite, proto_version, port, 1); | 80 | ret = test_daemon_get (NULL, cipher_suite, proto_version, port, 1); |
81 | 81 | ||
82 | MHD_stop_daemon (d); | 82 | MHD_stop_daemon (d); |
83 | return ret; | 83 | if (TEST_GET_HARD_ERROR == ret) |
84 | return 99; | ||
85 | if (TEST_GET_CURL_GEN_ERROR == ret) | ||
86 | { | ||
87 | fprintf (stderr, "libcurl error.\nTest aborted.\n"); | ||
88 | return 99; | ||
89 | } | ||
90 | if ((TEST_GET_CURL_CA_ERROR == ret) || | ||
91 | (TEST_GET_CURL_NOT_IMPLT == ret)) | ||
92 | { | ||
93 | fprintf (stderr, "libcurl TLS backend does not support custom CA.\n" | ||
94 | "Test skipped.\n"); | ||
95 | return 77; | ||
96 | } | ||
97 | return TEST_GET_OK == ret ? 0 : 1; | ||
84 | } | 98 | } |
85 | 99 | ||
86 | 100 | ||
87 | int | 101 | int |
88 | main (int argc, char *const *argv) | 102 | main (int argc, char *const *argv) |
89 | { | 103 | { |
90 | unsigned int errorCount = 0; | 104 | unsigned int errorCount; |
91 | (void) argc; | 105 | (void) argc; |
92 | (void) argv; /* Unused. Silent compiler warning. */ | 106 | (void) argv; /* Unused. Silent compiler warning. */ |
93 | 107 | ||
@@ -105,12 +119,25 @@ main (int argc, char *const *argv) | |||
105 | curl_global_cleanup (); | 119 | curl_global_cleanup (); |
106 | return 77; | 120 | return 77; |
107 | } | 121 | } |
122 | #if ! CURL_AT_LEAST_VERSION (7,60,0) | ||
123 | if (curl_tls_is_schannel ()) | ||
124 | { | ||
125 | fprintf (stderr, "libcurl before version 7.60.0 does not support " | ||
126 | "custom CA with Schannel backend.\nTest skipped.\n"); | ||
127 | curl_global_cleanup (); | ||
128 | return 77; | ||
129 | } | ||
130 | #endif /* ! CURL_AT_LEAST_VERSION(7,60,0) */ | ||
108 | 131 | ||
109 | errorCount += | 132 | errorCount = |
110 | test_secure_get (NULL, NULL, CURL_SSLVERSION_DEFAULT); | 133 | test_secure_get (NULL, NULL, CURL_SSLVERSION_DEFAULT); |
111 | 134 | ||
112 | print_test_result (errorCount, argv[0]); | 135 | print_test_result (errorCount, argv[0]); |
113 | 136 | ||
114 | curl_global_cleanup (); | 137 | curl_global_cleanup (); |
138 | if (77 == errorCount) | ||
139 | return 77; | ||
140 | if (99 == errorCount) | ||
141 | return 77; | ||
115 | return errorCount != 0 ? 1 : 0; | 142 | return errorCount != 0 ? 1 : 0; |
116 | } | 143 | } |