diff options
Diffstat (limited to 'src/transport/plugin_transport_https.c')
-rw-r--r-- | src/transport/plugin_transport_https.c | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/src/transport/plugin_transport_https.c b/src/transport/plugin_transport_https.c index 6cc9f9c7e..ea97712b5 100644 --- a/src/transport/plugin_transport_https.c +++ b/src/transport/plugin_transport_https.c | |||
@@ -370,6 +370,8 @@ struct Plugin | |||
370 | 370 | ||
371 | /* The private key MHD uses as an \0 terminated string */ | 371 | /* The private key MHD uses as an \0 terminated string */ |
372 | char * key; | 372 | char * key; |
373 | |||
374 | char * crypto_init; | ||
373 | }; | 375 | }; |
374 | 376 | ||
375 | 377 | ||
@@ -2347,7 +2349,8 @@ libgnunet_plugin_transport_https_done (void *cls) | |||
2347 | 2349 | ||
2348 | GNUNET_free_non_null (plugin->bind4_address); | 2350 | GNUNET_free_non_null (plugin->bind4_address); |
2349 | GNUNET_free_non_null (plugin->bind6_address); | 2351 | GNUNET_free_non_null (plugin->bind6_address); |
2350 | GNUNET_free_non_null(plugin->bind_hostname); | 2352 | GNUNET_free_non_null (plugin->bind_hostname); |
2353 | GNUNET_free_non_null (plugin->crypto_init); | ||
2351 | GNUNET_free (plugin); | 2354 | GNUNET_free (plugin); |
2352 | GNUNET_free (api); | 2355 | GNUNET_free (api); |
2353 | #if DEBUG_HTTPS | 2356 | #if DEBUG_HTTPS |
@@ -2453,6 +2456,34 @@ libgnunet_plugin_transport_https_init (void *cls) | |||
2453 | plugin->bind4_address = NULL; | 2456 | plugin->bind4_address = NULL; |
2454 | } | 2457 | } |
2455 | } | 2458 | } |
2459 | |||
2460 | /* Get crypto init string from config */ | ||
2461 | if (GNUNET_CONFIGURATION_have_value (env->cfg, | ||
2462 | "transport-https", "CRYPTO_INIT")) | ||
2463 | { | ||
2464 | GNUNET_CONFIGURATION_get_value_string (env->cfg, | ||
2465 | "transport-https", | ||
2466 | "CRYPTO_INIT", | ||
2467 | &plugin->crypto_init); | ||
2468 | } | ||
2469 | else | ||
2470 | { | ||
2471 | GNUNET_asprintf(&plugin->crypto_init,"NORMAL"); | ||
2472 | } | ||
2473 | |||
2474 | /* Get private key file from config */ | ||
2475 | if (GNUNET_CONFIGURATION_have_value (env->cfg, | ||
2476 | "transport-https", "CERT_FILE")) | ||
2477 | { | ||
2478 | GNUNET_CONFIGURATION_get_value_string (env->cfg, | ||
2479 | "transport-https", | ||
2480 | "CERT_FILE", | ||
2481 | &cert_file); | ||
2482 | } | ||
2483 | else | ||
2484 | { | ||
2485 | GNUNET_asprintf(&cert_file,"https.cert"); | ||
2486 | } | ||
2456 | 2487 | ||
2457 | /* Get private key file from config */ | 2488 | /* Get private key file from config */ |
2458 | if (GNUNET_CONFIGURATION_have_value (env->cfg, | 2489 | if (GNUNET_CONFIGURATION_have_value (env->cfg, |
@@ -2576,6 +2607,11 @@ libgnunet_plugin_transport_https_init (void *cls) | |||
2576 | port, | 2607 | port, |
2577 | &mhd_accept_cb, | 2608 | &mhd_accept_cb, |
2578 | plugin , &mdh_access_cb, plugin, | 2609 | plugin , &mdh_access_cb, plugin, |
2610 | /*MHD_OPTION_HTTPS_PRIORITIES, "NORMAL:",*/ | ||
2611 | /*MHD_OPTION_HTTPS_PRIORITIES, "PERFORMANCE:",*/ | ||
2612 | /* MHD_OPTION_HTTPS_PRIORITIES, "NONE:+VERS-TLS1.0:+ARCFOUR-128:+SHA1:+RSA:+COMP-NULL", */ | ||
2613 | /*MHD_OPTION_HTTPS_PRIORITIES, "NONE:+VERS-TLS1.0:+ARCFOUR-128:+MD5:+RSA:+COMP-NULL",*/ | ||
2614 | MHD_OPTION_HTTPS_PRIORITIES, plugin->crypto_init, | ||
2579 | MHD_OPTION_HTTPS_MEM_KEY, plugin->key, | 2615 | MHD_OPTION_HTTPS_MEM_KEY, plugin->key, |
2580 | MHD_OPTION_HTTPS_MEM_CERT, plugin->cert, | 2616 | MHD_OPTION_HTTPS_MEM_CERT, plugin->cert, |
2581 | MHD_OPTION_SOCK_ADDR, tmp, | 2617 | MHD_OPTION_SOCK_ADDR, tmp, |
@@ -2596,6 +2632,11 @@ libgnunet_plugin_transport_https_init (void *cls) | |||
2596 | port, | 2632 | port, |
2597 | &mhd_accept_cb, | 2633 | &mhd_accept_cb, |
2598 | plugin , &mdh_access_cb, plugin, | 2634 | plugin , &mdh_access_cb, plugin, |
2635 | /*MHD_OPTION_HTTPS_PRIORITIES, "NORMAL:",*/ | ||
2636 | /*MHD_OPTION_HTTPS_PRIORITIES, "PERFORMANCE:",*/ | ||
2637 | /* MHD_OPTION_HTTPS_PRIORITIES, "NONE:+VERS-TLS1.0:+ARCFOUR-128:+SHA1:+RSA:+COMP-NULL", */ | ||
2638 | /*MHD_OPTION_HTTPS_PRIORITIES, "NONE:+VERS-TLS1.0:+ARCFOUR-128:+MD5:+RSA:+COMP-NULL",*/ | ||
2639 | MHD_OPTION_HTTPS_PRIORITIES, plugin->crypto_init, | ||
2599 | MHD_OPTION_HTTPS_MEM_KEY, plugin->key, | 2640 | MHD_OPTION_HTTPS_MEM_KEY, plugin->key, |
2600 | MHD_OPTION_HTTPS_MEM_CERT, plugin->cert, | 2641 | MHD_OPTION_HTTPS_MEM_CERT, plugin->cert, |
2601 | MHD_OPTION_SOCK_ADDR, (struct sockaddr_in *)plugin->bind4_address, | 2642 | MHD_OPTION_SOCK_ADDR, (struct sockaddr_in *)plugin->bind4_address, |