aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-10-16 23:20:19 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-10-16 23:20:19 +0300
commit59fd27abd2fc4e0201695976edfdde84fe37aea0 (patch)
tree11af0390ea7886f915590b1a74555898d6fab7d6 /src/config.c
parent086f544ad76e8d9560c39d11ea556c570e46d7c4 (diff)
downloadeclat-59fd27abd2fc4e0201695976edfdde84fe37aea0.tar.gz
eclat-59fd27abd2fc4e0201695976edfdde84fe37aea0.tar.bz2
Provide configuration statements for SSL control.
* doc/eclat.conf.5: Document new configuration statements. * src/cmdline.opt (replvar): Change structure. (replace_int_var): New function. * src/config.c: Use "ssl" as a block or scalar statement. * src/eclat.c (ssl_verify_peer, ssl_ca_file) (ssl_ca_path): New variables. (main): Set up SSL configuration. * src/eclat.h (ssl_verify_peer, ssl_ca_file) (ssl_ca_path): New protos.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 0712110..f58747c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -148,7 +148,42 @@ cb_define_format(enum grecs_callback_command cmd,
&value->v.arg.v[1]->locus);
return 0;
}
+
+static struct grecs_keyword ssl_kw[] = {
+ { "enable", NULL,
+ "Use SSL",
+ grecs_type_bool, GRECS_DFLT, &use_ssl },
+ { "verify", NULL,
+ "Verify peer certificate",
+ grecs_type_bool, GRECS_DFLT, &ssl_verify_peer },
+ { "ca-file", NULL,
+ "File holding CA certificates",
+ grecs_type_string, GRECS_DFLT, &ssl_ca_file },
+ { "ca-path", NULL,
+ "Directory holding files with CA certificates",
+ grecs_type_string, GRECS_DFLT, &ssl_ca_path },
+ { NULL }
+};
+static int
+cb_ssl(enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
+ void *varptr,
+ grecs_value_t *value,
+ void *cb_data)
+{
+ if (cmd == grecs_callback_set_value) {
+ if (!value || value->type != GRECS_TYPE_STRING ||
+ grecs_string_convert(&use_ssl, grecs_type_bool,
+ value->v.string, &value->locus)) {
+ grecs_error (value ? &value->locus : locus, 0,
+ _("expected boolean value"));
+ return 1;
+ }
+ }
+ return 0;
+}
+
static struct grecs_keyword eclat_kw[] = {
{ "default-endpoint", "hostname",
"Set default EC2 endpoint",
@@ -162,6 +197,17 @@ static struct grecs_keyword eclat_kw[] = {
{ "default-region", "name",
"Define default AWS region",
grecs_type_string, GRECS_DFLT, &region_name },
+ { "ssl", NULL,
+ "Configure SSL. The ssl keyword can also be used in scalar form, like this:\n\n"
+ " ssl yes;\n"
+ "\n"
+ "Use this form if you don't need any fine tuning and only wish to enable\n"
+ "or disable SSL.\n\n"
+ "By default SSL is disabled."
+ ,
+ grecs_type_section, GRECS_DFLT,
+ NULL, 0,
+ cb_ssl, NULL, ssl_kw },
{ "format", "<command: string> <format: string>",
"Set default format for <command>",
grecs_type_string, GRECS_MULT, NULL, 0, cb_format },

Return to:

Send suggestions and report system problems to the System administrator.