aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-09-19 12:51:44 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-09-19 12:51:44 +0000
commit036a298f529e8c060c4b650a16f2cd4307018311 (patch)
tree80c4d9888f01b789223c340131e8da513a723c37
parentb0967c5c5933aa4cd6d389d520d04fcf49e8cfe6 (diff)
downloadgnunet-036a298f529e8c060c4b650a16f2cd4307018311.tar.gz
gnunet-036a298f529e8c060c4b650a16f2cd4307018311.zip
move https cert location to servicehome
-rw-r--r--src/transport/plugin_transport_http_server.c28
-rw-r--r--src/transport/transport.conf.in4
2 files changed, 24 insertions, 8 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 3b2132dda..e8250af8b 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -1646,10 +1646,10 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
1646 last_timeout, timeout); 1646 last_timeout, timeout);
1647 last_timeout = timeout; 1647 last_timeout = timeout;
1648 } 1648 }
1649 //if (timeout <= GNUNET_TIME_UNIT_SECONDS.rel_value) 1649 if (timeout <= GNUNET_TIME_UNIT_SECONDS.rel_value)
1650 tv.rel_value = (uint64_t) timeout; 1650 tv.rel_value = (uint64_t) timeout;
1651 //else 1651 else
1652 //tv = GNUNET_TIME_UNIT_SECONDS; 1652 tv = GNUNET_TIME_UNIT_SECONDS;
1653 } 1653 }
1654 else 1654 else
1655 tv = GNUNET_TIME_UNIT_SECONDS; 1655 tv = GNUNET_TIME_UNIT_SECONDS;
@@ -1750,12 +1750,25 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin)
1750{ 1750{
1751 int res = GNUNET_OK; 1751 int res = GNUNET_OK;
1752 1752
1753 char *sh;
1753 char *key_file; 1754 char *key_file;
1754 char *cert_file; 1755 char *cert_file;
1755 1756
1756 /* Get crypto init string from config 1757 /* Get crypto init string from config
1757 * If not present just use default values */ 1758 * If not present just use default values */
1758 1759
1760 if (GNUNET_OK !=
1761 GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg,
1762 "PATHS",
1763 "SERVICEHOME",
1764 &sh))
1765 {
1766 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
1767 "Failed to get servicehome!\n");
1768 return GNUNET_SYSERR;
1769 }
1770
1771
1759 if (GNUNET_OK == 1772 if (GNUNET_OK ==
1760 GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg, 1773 GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg,
1761 plugin->name, 1774 plugin->name,
@@ -1772,16 +1785,19 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin)
1772 GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name, 1785 GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name,
1773 "KEY_FILE", &key_file)) 1786 "KEY_FILE", &key_file))
1774 { 1787 {
1775 key_file = GNUNET_strdup ("https_key.key"); 1788 GNUNET_break (0);
1789 GNUNET_asprintf (&key_file, "%s/%s", sh, "https_key.key");
1776 } 1790 }
1777 1791
1792
1778 if (GNUNET_OK != 1793 if (GNUNET_OK !=
1779 GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name, 1794 GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name,
1780 "CERT_FILE", &cert_file)) 1795 "CERT_FILE", &cert_file))
1781 { 1796 {
1782 GNUNET_asprintf (&cert_file, "%s", "https_cert.crt"); 1797 GNUNET_break (0);
1798 GNUNET_asprintf (&cert_file, "%s/%s", sh, "https_cert.crt");
1783 } 1799 }
1784 1800 GNUNET_free (sh);
1785 /* read key & certificates from file */ 1801 /* read key & certificates from file */
1786 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1802 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1787 "Trying to loading TLS certificate from key-file `%s' cert-file`%s'\n", 1803 "Trying to loading TLS certificate from key-file `%s' cert-file`%s'\n",
diff --git a/src/transport/transport.conf.in b/src/transport/transport.conf.in
index c08d2a939..c6c752d8a 100644
--- a/src/transport/transport.conf.in
+++ b/src/transport/transport.conf.in
@@ -70,8 +70,8 @@ TESTING_IGNORE_KEYS = ACCEPT_FROM;
70[transport-https_server] 70[transport-https_server]
71PORT = 4433 71PORT = 4433
72CRYPTO_INIT = NORMAL 72CRYPTO_INIT = NORMAL
73KEY_FILE = https.key 73KEY_FILE = $SERVICEHOME/https.key
74CERT_FILE = https.cert 74CERT_FILE = $SERVICEHOME/https.cert
75MAX_CONNECTIONS = 128 75MAX_CONNECTIONS = 128
76TESTING_IGNORE_KEYS = ACCEPT_FROM; 76TESTING_IGNORE_KEYS = ACCEPT_FROM;
77 77