summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-09 10:05:42 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-09 10:05:42 +0000
commit2032baa561c7fefbe2605f5d6b979a295a61637d (patch)
tree2c2a2f1c92940a51ccb565c8fdc1b381a68d8bb4 /src/transport
parent0f6f7fdb0ee4172951f8cb1431d2e457a4b83716 (diff)
migrating towards XDG configuration specification (#3000)
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/plugin_transport_http_server.c58
-rw-r--r--src/transport/transport.conf.in17
2 files changed, 30 insertions, 45 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 323379d3e..8e6eff072 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -1868,61 +1868,47 @@ server_load_file (const char *file)
* Load ssl certificate
*
* @param plugin the plugin
- * @return GNUNET_OK on success, GNUNET_SYSERR on failure
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
*/
static int
server_load_certificate (struct HTTP_Server_Plugin *plugin)
{
int res = GNUNET_OK;
-
- char *sh;
char *key_file;
char *cert_file;
- /* Get crypto init string from config
- * If not present just use default values */
-
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg,
- "PATHS",
- "SERVICEHOME",
- &sh))
- {
- GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
- "Failed to get servicehome!\n");
- return GNUNET_SYSERR;
- }
-
-
- if (GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg,
- plugin->name,
- "CRYPTO_INIT",
- &plugin->crypto_init))
- GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
- "Using crypto init string `%s'\n",
- plugin->crypto_init);
- else
- GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
- "Using default crypto init string \n");
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name,
"KEY_FILE", &key_file))
{
- GNUNET_break (0);
- GNUNET_asprintf (&key_file, "%s/%s", sh, "https_key.key");
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ plugin->name, "CERT_FILE");
+ return GNUNET_SYSERR;
}
-
-
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name,
"CERT_FILE", &cert_file))
{
- GNUNET_break (0);
- GNUNET_asprintf (&cert_file, "%s/%s", sh, "https_cert.crt");
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ plugin->name, "CERT_FILE");
+ GNUNET_free (key_file);
+ return GNUNET_SYSERR;
}
- GNUNET_free (sh);
+ /* Get crypto init string from config. If not present, use
+ * default values */
+ if (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg,
+ plugin->name,
+ "CRYPTO_INIT",
+ &plugin->crypto_init))
+ GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+ "Using crypto init string `%s'\n",
+ plugin->crypto_init);
+ else
+ GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+ "Using default crypto init string \n");
+
/* read key & certificates from file */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"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 fd8b5dbbb..d9abdbf11 100644
--- a/src/transport/transport.conf.in
+++ b/src/transport/transport.conf.in
@@ -2,7 +2,6 @@
AUTOSTART = YES
@UNIXONLY@ PORT = 2091
HOSTNAME = localhost
-HOME = $SERVICEHOME
BINARY = gnunet-service-transport
#PREFIX = valgrind
NEIGHBOUR_LIMIT = 50
@@ -10,11 +9,11 @@ ACCEPT_FROM = 127.0.0.1;
ACCEPT_FROM6 = ::1;
PLUGINS = tcp udp
UNIXPATH = /tmp/gnunet-service-transport.sock
-BLACKLIST_FILE = $SERVICEHOME/blacklist
+BLACKLIST_FILE = $GNUNET_CONFIG_HOME/transport/blacklist
UNIX_MATCH_UID = NO
UNIX_MATCH_GID = YES
# DISABLE_SOCKET_FORWARDING = NO
-# USERNAME =
+# USERNAME =
# MAXBUF =
# TIMEOUT =
# DISABLEV6 =
@@ -26,11 +25,11 @@ UNIX_MATCH_GID = YES
# Configuration settings related to traffic manipulation for testing purposes
# Distance
# MANIPULATE_DISTANCE_IN = 1
-# MANIPULATE_DISTANCE_OUT = 1
+# MANIPULATE_DISTANCE_OUT = 1
# Delay; WARNING: to large values may lead to peers not connecting!
# MANIPULATE_DELAY_IN = 1 ms
# MANIPULATE_DELAY_OUT = 1 ms
-
+
[transport-unix]
PORT = 22086
@@ -79,16 +78,16 @@ TESTING_IGNORE_KEYS = ACCEPT_FROM;
[transport-https_server]
# EXTERNAL_HOSTNAME = <your hostname/path>
# EXTERNAL_HOSTNAME_ONLY = YES
-# If you have a valid SSL certificate for your external hostname tell,
-# clients to verify it
+# If you have a valid SSL certificate for your external hostname tell,
+# clients to verify it
# VERIFY_EXTERNAL_HOSTNAME = YES
# Does the external hostname use the same port?
# EXTERNAL_HOSTNAME_USE_PORT = YES
PORT = 4433
ADVERTISED_PORT = 4433
CRYPTO_INIT = NORMAL
-KEY_FILE = $SERVICEHOME/https.key
-CERT_FILE = $SERVICEHOME/https.cert
+KEY_FILE = $GNUNET_DATA_HOME/transport/https.key
+CERT_FILE = $GNUNET_DATA_HOME/transport/https.cert
MAX_CONNECTIONS = 128
TESTING_IGNORE_KEYS = ACCEPT_FROM;