diff options
Diffstat (limited to 'src/testcurl/https/test_tls_authentication.c')
-rw-r--r-- | src/testcurl/https/test_tls_authentication.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/testcurl/https/test_tls_authentication.c b/src/testcurl/https/test_tls_authentication.c index b5fe8f28..9f337a32 100644 --- a/src/testcurl/https/test_tls_authentication.c +++ b/src/testcurl/https/test_tls_authentication.c | |||
@@ -73,24 +73,31 @@ int | |||
73 | main (int argc, char *const *argv) | 73 | main (int argc, char *const *argv) |
74 | { | 74 | { |
75 | unsigned int errorCount = 0; | 75 | unsigned int errorCount = 0; |
76 | char *aes256_sha = "AES256-SHA"; | ||
76 | 77 | ||
77 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 78 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
78 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 79 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
79 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 80 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
80 | #endif | 81 | #endif |
81 | if (setup_ca_cert () == NULL) | 82 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
82 | { | 83 | { |
83 | fprintf (stderr, MHD_E_TEST_FILE_CREAT); | 84 | fprintf (stderr, "Error (code: %u)\n", errorCount); |
84 | return -1; | 85 | return 99; |
86 | } | ||
87 | if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version) | ||
88 | { | ||
89 | fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n"); | ||
90 | curl_global_cleanup (); | ||
91 | return 77; | ||
85 | } | 92 | } |
86 | 93 | ||
87 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 94 | if (setup_ca_cert () == NULL) |
88 | { | 95 | { |
89 | fprintf (stderr, "Error (code: %u)\n", errorCount); | 96 | fprintf (stderr, MHD_E_TEST_FILE_CREAT); |
90 | return -1; | 97 | curl_global_cleanup (); |
98 | return 99; | ||
91 | } | 99 | } |
92 | 100 | ||
93 | char *aes256_sha = "AES256-SHA"; | ||
94 | if (curl_uses_nss_ssl() == 0) | 101 | if (curl_uses_nss_ssl() == 0) |
95 | { | 102 | { |
96 | aes256_sha = "rsa_aes_256_sha"; | 103 | aes256_sha = "rsa_aes_256_sha"; |
@@ -106,5 +113,5 @@ main (int argc, char *const *argv) | |||
106 | fprintf (stderr, | 113 | fprintf (stderr, |
107 | "Failed to remove `%s'\n", | 114 | "Failed to remove `%s'\n", |
108 | ca_cert_file_name); | 115 | ca_cert_file_name); |
109 | return errorCount != 0; | 116 | return errorCount != 0 ? 1 : 0; |
110 | } | 117 | } |