test_https_sni: limit to libcrul with certain TLS backends.

NSS can't be used with SSL_VERIFYPEER disabled, while SSL_VERIFYHOST is
enabled, other backends may have some problems as well.
This commit is contained in:
Evgeny Grin (Karlson2k)
2022-04-21 13:40:10 +03:00
parent fc649c7bf3
commit a3ce7049bd
2 changed files with 31 additions and 1 deletions
+11 -1
View File
@@ -257,6 +257,7 @@ main (int argc, char *const *argv)
struct MHD_Daemon *d;
int port;
(void) argc; /* Unused. Silent compiler warning. */
const char *tls_backend;
if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
port = 0;
@@ -271,12 +272,21 @@ main (int argc, char *const *argv)
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
if (! testsuite_curl_global_init ())
return 99;
if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
tls_backend = curl_version_info (CURLVERSION_NOW)->ssl_version;
if (NULL == tls_backend)
{
fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n");
curl_global_cleanup ();
return 77;
}
if (! curl_tls_is_gnutls () && ! curl_tls_is_openssl ())
{
fprintf (stderr, "This test is reliable only with libcurl with GnuTLS or "
"OpenSSL backends.\nSkipping the test as libcurl has '%s' "
"backend.\n", tls_backend);
curl_global_cleanup ();
return 77;
}
load_keys ("mhdhost1", ABS_SRCDIR "/mhdhost1.crt",
ABS_SRCDIR "/mhdhost1.key");
+20
View File
@@ -601,6 +601,26 @@ curl_tls_is_gnutls (void)
}
int
curl_tls_is_openssl (void)
{
const char *tlslib;
if (inited_tls_is_gnutls)
return 0;
if (inited_tls_is_openssl)
return 1;
tlslib = curl_version_info (CURLVERSION_NOW)->ssl_version;
if (NULL == tlslib)
return 0;
if (0 == strncmp (tlslib, "OpenSSL/", 8))
return 1;
/* Multi-backends handled during initialization by setting variable */
return 0;
}
int
curl_tls_is_nss (void)
{