diff options
Diffstat (limited to 'src/testcurl/https')
-rw-r--r-- | src/testcurl/https/test_https_sni.c | 12 | ||||
-rw-r--r-- | src/testcurl/https/tls_test_common.c | 20 |
2 files changed, 31 insertions, 1 deletions
diff --git a/src/testcurl/https/test_https_sni.c b/src/testcurl/https/test_https_sni.c index cc7d1f43..4ffe1d8f 100644 --- a/src/testcurl/https/test_https_sni.c +++ b/src/testcurl/https/test_https_sni.c | |||
@@ -257,6 +257,7 @@ main (int argc, char *const *argv) | |||
257 | struct MHD_Daemon *d; | 257 | struct MHD_Daemon *d; |
258 | int port; | 258 | int port; |
259 | (void) argc; /* Unused. Silent compiler warning. */ | 259 | (void) argc; /* Unused. Silent compiler warning. */ |
260 | const char *tls_backend; | ||
260 | 261 | ||
261 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 262 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
262 | port = 0; | 263 | port = 0; |
@@ -271,12 +272,21 @@ main (int argc, char *const *argv) | |||
271 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | 272 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ |
272 | if (! testsuite_curl_global_init ()) | 273 | if (! testsuite_curl_global_init ()) |
273 | return 99; | 274 | return 99; |
274 | if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version) | 275 | tls_backend = curl_version_info (CURLVERSION_NOW)->ssl_version; |
276 | if (NULL == tls_backend) | ||
275 | { | 277 | { |
276 | fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n"); | 278 | fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n"); |
277 | curl_global_cleanup (); | 279 | curl_global_cleanup (); |
278 | return 77; | 280 | return 77; |
279 | } | 281 | } |
282 | if (! curl_tls_is_gnutls () && ! curl_tls_is_openssl ()) | ||
283 | { | ||
284 | fprintf (stderr, "This test is reliable only with libcurl with GnuTLS or " | ||
285 | "OpenSSL backends.\nSkipping the test as libcurl has '%s' " | ||
286 | "backend.\n", tls_backend); | ||
287 | curl_global_cleanup (); | ||
288 | return 77; | ||
289 | } | ||
280 | 290 | ||
281 | load_keys ("mhdhost1", ABS_SRCDIR "/mhdhost1.crt", | 291 | load_keys ("mhdhost1", ABS_SRCDIR "/mhdhost1.crt", |
282 | ABS_SRCDIR "/mhdhost1.key"); | 292 | ABS_SRCDIR "/mhdhost1.key"); |
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c index 36134ecc..8d33e5d4 100644 --- a/src/testcurl/https/tls_test_common.c +++ b/src/testcurl/https/tls_test_common.c | |||
@@ -602,6 +602,26 @@ curl_tls_is_gnutls (void) | |||
602 | 602 | ||
603 | 603 | ||
604 | int | 604 | int |
605 | curl_tls_is_openssl (void) | ||
606 | { | ||
607 | const char *tlslib; | ||
608 | if (inited_tls_is_gnutls) | ||
609 | return 0; | ||
610 | if (inited_tls_is_openssl) | ||
611 | return 1; | ||
612 | |||
613 | tlslib = curl_version_info (CURLVERSION_NOW)->ssl_version; | ||
614 | if (NULL == tlslib) | ||
615 | return 0; | ||
616 | if (0 == strncmp (tlslib, "OpenSSL/", 8)) | ||
617 | return 1; | ||
618 | |||
619 | /* Multi-backends handled during initialization by setting variable */ | ||
620 | return 0; | ||
621 | } | ||
622 | |||
623 | |||
624 | int | ||
605 | curl_tls_is_nss (void) | 625 | curl_tls_is_nss (void) |
606 | { | 626 | { |
607 | const char *tlslib; | 627 | const char *tlslib; |