diff options
author | Christian Grothoff <christian@grothoff.org> | 2008-09-11 02:45:32 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2008-09-11 02:45:32 +0000 |
commit | 047188f0f7e658682c4983c6b05f8b26845904eb (patch) | |
tree | 0765f3b093d98c9facb0e029af8ca852df1634cd | |
parent | b69a5b3500f257360c5efd85fe8fbd075e666769 (diff) | |
download | libmicrohttpd-047188f0f7e658682c4983c6b05f8b26845904eb.tar.gz libmicrohttpd-047188f0f7e658682c4983c6b05f8b26845904eb.zip |
done
-rw-r--r-- | src/testcurl/https/key.pem | 2 | ||||
-rw-r--r-- | src/testcurl/https/tls_daemon_options_test.c | 49 |
2 files changed, 2 insertions, 49 deletions
diff --git a/src/testcurl/https/key.pem b/src/testcurl/https/key.pem index 60bebe3f..a5848eed 100644 --- a/src/testcurl/https/key.pem +++ b/src/testcurl/https/key.pem | |||
@@ -24,4 +24,4 @@ QCdXR6o2IYgR6jnSewrZKlA9aPqFJrwHNR6sNXlnSmt5Fcf/RWO/qgJQGLUv3+rG | |||
24 | P3gXeQKBgBusb8Rbd+KgxSA0hwY6aoRTPRt8LNvXdsB9vRcKKHUFQvxUWiUSS+L9 | 24 | P3gXeQKBgBusb8Rbd+KgxSA0hwY6aoRTPRt8LNvXdsB9vRcKKHUFQvxUWiUSS+L9 |
25 | /Qu1sJbrUquKOHqksV5wCnWnAKyJNJlhHuBToqQTgKXjuNmVdYSe631saiI7PHyC | 25 | /Qu1sJbrUquKOHqksV5wCnWnAKyJNJlhHuBToqQTgKXjuNmVdYSe631saiI7PHyC |
26 | eRJ6DxULPxABytJrYCRrNqmXi5TCiqR2mtfalEMOPxz8rUU8dYyx | 26 | eRJ6DxULPxABytJrYCRrNqmXi5TCiqR2mtfalEMOPxz8rUU8dYyx |
27 | -----END RSA PRIVATE KEY-----; | 27 | -----END RSA PRIVATE KEY----- |
diff --git a/src/testcurl/https/tls_daemon_options_test.c b/src/testcurl/https/tls_daemon_options_test.c index 4424a065..38a8c1d5 100644 --- a/src/testcurl/https/tls_daemon_options_test.c +++ b/src/testcurl/https/tls_daemon_options_test.c | |||
@@ -306,53 +306,6 @@ test_wrap (char *test_name, int | |||
306 | return ret; | 306 | return ret; |
307 | } | 307 | } |
308 | 308 | ||
309 | /* perform a HTTP GET request via SSL/TLS */ | ||
310 | |||
311 | /* test loading of key & certificate files */ | ||
312 | int | ||
313 | test_file_certificates (FILE * test_fd, char *cipher_suite, int proto_version) | ||
314 | { | ||
315 | int ret; | ||
316 | struct MHD_Daemon *d; | ||
317 | FILE *cert_fd, *key_fd; | ||
318 | char cert_path[255], key_path[255], *cur_dir; | ||
319 | |||
320 | cur_dir = get_current_dir_name (); | ||
321 | |||
322 | sprintf (cert_path, "%s/%s", cur_dir, "cert.pem"); | ||
323 | sprintf (key_path, "%s/%s", cur_dir, "key.pem"); | ||
324 | |||
325 | if (NULL == (key_fd = fopen (key_path, "w+"))) | ||
326 | { | ||
327 | fprintf (stderr, MHD_E_KEY_FILE_CREAT); | ||
328 | return -1; | ||
329 | } | ||
330 | if (NULL == (cert_fd = fopen (cert_path, "w+"))) | ||
331 | { | ||
332 | fprintf (stderr, MHD_E_CERT_FILE_CREAT); | ||
333 | return -1; | ||
334 | } | ||
335 | |||
336 | fwrite (srv_key_pem, strlen (srv_key_pem), sizeof (char), key_fd); | ||
337 | fwrite (srv_self_signed_cert_pem, strlen (srv_self_signed_cert_pem), | ||
338 | sizeof (char), cert_fd); | ||
339 | fclose (key_fd); | ||
340 | fclose (cert_fd); | ||
341 | |||
342 | if (d == NULL) | ||
343 | { | ||
344 | fprintf (stderr, MHD_E_SERVER_INIT); | ||
345 | return -1; | ||
346 | } | ||
347 | |||
348 | ret = test_https_transfer (test_fd, cipher_suite, proto_version); | ||
349 | |||
350 | free (cur_dir); | ||
351 | remove (cert_path); | ||
352 | remove (key_path); | ||
353 | return ret; | ||
354 | } | ||
355 | |||
356 | /* | 309 | /* |
357 | * test server refuses to negotiate connections with unsupported protocol versions | 310 | * test server refuses to negotiate connections with unsupported protocol versions |
358 | */ | 311 | */ |
@@ -442,7 +395,7 @@ main (int argc, char *const *argv) | |||
442 | sprintf (key_path, "%s/%s", cur_dir, "key.pem"); | 395 | sprintf (key_path, "%s/%s", cur_dir, "key.pem"); |
443 | 396 | ||
444 | errorCount += | 397 | errorCount += |
445 | test_wrap ("file certificates", &test_file_certificates, test_fd, | 398 | test_wrap ("file certificates", &test_https_transfer, test_fd, |
446 | "AES256-SHA", CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_CERT_PATH, cert_path, | 399 | "AES256-SHA", CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_CERT_PATH, cert_path, |
447 | MHD_OPTION_HTTPS_KEY_PATH, key_path, MHD_OPTION_END); | 400 | MHD_OPTION_HTTPS_KEY_PATH, key_path, MHD_OPTION_END); |
448 | free (cur_dir); | 401 | free (cur_dir); |