aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/https/test_https_multi_daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/https/test_https_multi_daemon.c')
-rw-r--r--src/testcurl/https/test_https_multi_daemon.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/testcurl/https/test_https_multi_daemon.c b/src/testcurl/https/test_https_multi_daemon.c
index 54efcabb..30b76713 100644
--- a/src/testcurl/https/test_https_multi_daemon.c
+++ b/src/testcurl/https/test_https_multi_daemon.c
@@ -29,7 +29,7 @@
29#include <curl/curl.h> 29#include <curl/curl.h>
30#include <limits.h> 30#include <limits.h>
31#include <sys/stat.h> 31#include <sys/stat.h>
32 32#include <gcrypt.h>
33#include "tls_test_common.h" 33#include "tls_test_common.h"
34 34
35extern int curl_check_version (const char *req_version, ...); 35extern int curl_check_version (const char *req_version, ...);
@@ -40,14 +40,16 @@ extern const char srv_self_signed_cert_pem[];
40 * assert initiating two separate daemons and having one shut down 40 * assert initiating two separate daemons and having one shut down
41 * doesn't affect the other 41 * doesn't affect the other
42 */ 42 */
43int 43static int
44test_concurent_daemon_pair (void * cls, char *cipher_suite, 44test_concurent_daemon_pair (void *cls,
45 const char *cipher_suite,
45 int proto_version) 46 int proto_version)
46{ 47{
47 48
48 int ret; 49 int ret;
49 struct MHD_Daemon *d1; 50 struct MHD_Daemon *d1;
50 struct MHD_Daemon *d2; 51 struct MHD_Daemon *d2;
52
51 d1 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL | 53 d1 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL |
52 MHD_USE_DEBUG, DEAMON_TEST_PORT, 54 MHD_USE_DEBUG, DEAMON_TEST_PORT,
53 NULL, NULL, &http_ahc, NULL, 55 NULL, NULL, &http_ahc, NULL,
@@ -88,12 +90,21 @@ test_concurent_daemon_pair (void * cls, char *cipher_suite,
88 return ret; 90 return ret;
89} 91}
90 92
93
94GCRY_THREAD_OPTION_PTHREAD_IMPL;
95
96
91int 97int
92main (int argc, char *const *argv) 98main (int argc, char *const *argv)
93{ 99{
94 unsigned int errorCount = 0; 100 unsigned int errorCount = 0;
95 FILE *cert; 101 FILE *cert;
96 102
103 gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
104 gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
105#ifdef GCRYCTL_INITIALIZATION_FINISHED
106 gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
107#endif
97 if (0 != curl_global_init (CURL_GLOBAL_ALL)) 108 if (0 != curl_global_init (CURL_GLOBAL_ALL))
98 { 109 {
99 fprintf (stderr, "Error (code: %u). l:%d f:%s\n", errorCount, __LINE__, 110 fprintf (stderr, "Error (code: %u). l:%d f:%s\n", errorCount, __LINE__,
@@ -106,7 +117,7 @@ main (int argc, char *const *argv)
106 return -1; 117 return -1;
107 } 118 }
108 119
109 char *aes256_sha = "AES256-SHA"; 120 const char *aes256_sha = "AES256-SHA";
110 if (curl_uses_nss_ssl() == 0) 121 if (curl_uses_nss_ssl() == 0)
111 { 122 {
112 aes256_sha = "rsa_aes_256_sha"; 123 aes256_sha = "rsa_aes_256_sha";