aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/https/test_https_get.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/https/test_https_get.c')
-rw-r--r--src/testcurl/https/test_https_get.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/testcurl/https/test_https_get.c b/src/testcurl/https/test_https_get.c
index f279ac9f..f076cac4 100644
--- a/src/testcurl/https/test_https_get.c
+++ b/src/testcurl/https/test_https_get.c
@@ -19,7 +19,7 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file mhds_get_test.c 22 * @file test_https_get.c
23 * @brief Testcase for libmicrohttpd HTTPS GET operations 23 * @brief Testcase for libmicrohttpd HTTPS GET operations
24 * @author Sagie Amir 24 * @author Sagie Amir
25 */ 25 */
@@ -37,8 +37,11 @@ extern const char srv_self_signed_cert_pem[];
37extern const char srv_signed_cert_pem[]; 37extern const char srv_signed_cert_pem[];
38extern const char srv_signed_key_pem[]; 38extern const char srv_signed_key_pem[];
39 39
40
40static int 41static int
41test_cipher_option (FILE * test_fd, char *cipher_suite, int proto_version) 42test_cipher_option (FILE * test_fd,
43 const char *cipher_suite,
44 int proto_version)
42{ 45{
43 46
44 int ret; 47 int ret;
@@ -62,9 +65,12 @@ test_cipher_option (FILE * test_fd, char *cipher_suite, int proto_version)
62 return ret; 65 return ret;
63} 66}
64 67
68
65/* perform a HTTP GET request via SSL/TLS */ 69/* perform a HTTP GET request via SSL/TLS */
66int 70static int
67test_secure_get (FILE * test_fd, char *cipher_suite, int proto_version) 71test_secure_get (FILE * test_fd,
72 const char *cipher_suite,
73 int proto_version)
68{ 74{
69 int ret; 75 int ret;
70 struct MHD_Daemon *d; 76 struct MHD_Daemon *d;
@@ -88,10 +94,15 @@ test_secure_get (FILE * test_fd, char *cipher_suite, int proto_version)
88 return ret; 94 return ret;
89} 95}
90 96
97
91int 98int
92main (int argc, char *const *argv) 99main (int argc, char *const *argv)
93{ 100{
94 unsigned int errorCount = 0; 101 unsigned int errorCount = 0;
102 const char *aes256_sha_tlsv1 = "AES256-SHA";
103 const char *aes256_sha_sslv3 = "AES256-SHA";
104 const char *des_cbc3_sha_tlsv1 = "DES-CBC3-SHA";
105
95 106
96 if (!gcry_check_version (GCRYPT_VERSION)) 107 if (!gcry_check_version (GCRYPT_VERSION))
97 abort (); 108 abort ();
@@ -101,13 +112,9 @@ main (int argc, char *const *argv)
101 return -1; 112 return -1;
102 } 113 }
103 114
104 char *aes256_sha_tlsv1 = "AES256-SHA";
105 char *aes256_sha_sslv3 = "AES256-SHA";
106 char *des_cbc3_sha_tlsv1 = "DES-CBC3-SHA";
107
108 if (curl_uses_nss_ssl() == 0) 115 if (curl_uses_nss_ssl() == 0)
109 { 116 {
110 aes256_sha_tlsv1 = "rsa_aes_256_sha"; 117 aes256_sha_tlsv1 = "rsa_aes_256_sha";
111 aes256_sha_sslv3 = "rsa_aes_256_sha"; 118 aes256_sha_sslv3 = "rsa_aes_256_sha";
112 des_cbc3_sha_tlsv1 = "rsa_aes_128_sha"; 119 des_cbc3_sha_tlsv1 = "rsa_aes_128_sha";
113 } 120 }
@@ -118,7 +125,6 @@ main (int argc, char *const *argv)
118 test_secure_get (NULL, aes256_sha_sslv3, CURL_SSLVERSION_SSLv3); 125 test_secure_get (NULL, aes256_sha_sslv3, CURL_SSLVERSION_SSLv3);
119 errorCount += 126 errorCount +=
120 test_cipher_option (NULL, des_cbc3_sha_tlsv1, CURL_SSLVERSION_TLSv1); 127 test_cipher_option (NULL, des_cbc3_sha_tlsv1, CURL_SSLVERSION_TLSv1);
121
122 print_test_result (errorCount, argv[0]); 128 print_test_result (errorCount, argv[0]);
123 129
124 curl_global_cleanup (); 130 curl_global_cleanup ();