Code

sysdb: Add -A option to specify a CA certificates file.
authorSebastian Harl <sh@tokkee.org>
Sun, 1 Feb 2015 10:55:55 +0000 (11:55 +0100)
committerSebastian Harl <sh@tokkee.org>
Sun, 1 Feb 2015 14:00:37 +0000 (15:00 +0100)
src/tools/sysdb/main.c

index 228cd530b6098906ae5f709f84aabf91a0c49ee9..e9e2202635d1d89dcb238a6e6c18dd7b295695cb 100644 (file)
@@ -132,6 +132,8 @@ exit_usage(char *name, int status)
 "               default: %s\n"
 "  -C CERTFILE  client certificate file name\n"
 "               default: %s\n"
 "               default: %s\n"
 "  -C CERTFILE  client certificate file name\n"
 "               default: %s\n"
+"  -A CAFILE    CA certificates file name\n"
+"               default: %s\n"
 "\n"
 "General options:\n"
 "\n"
 "\n"
 "General options:\n"
 "\n"
@@ -140,7 +142,7 @@ exit_usage(char *name, int status)
 
 "\nSysDB client "SDB_CLIENT_VERSION_STRING SDB_CLIENT_VERSION_EXTRA", "
 PACKAGE_URL"\n", basename(name), user,
 
 "\nSysDB client "SDB_CLIENT_VERSION_STRING SDB_CLIENT_VERSION_EXTRA", "
 PACKAGE_URL"\n", basename(name), user,
-                       ssl_options.key_file, ssl_options.cert_file);
+                       ssl_options.key_file, ssl_options.cert_file, ssl_options.ca_file);
 
        free(user);
        exit(status);
 
        free(user);
        exit(status);
@@ -227,7 +229,7 @@ main(int argc, char **argv)
        sdb_llist_t *commands = NULL;
 
        while (42) {
        sdb_llist_t *commands = NULL;
 
        while (42) {
-               int opt = getopt(argc, argv, "H:U:c:C:K:hV");
+               int opt = getopt(argc, argv, "H:U:c:C:K:A:hV");
 
                if (-1 == opt)
                        break;
 
                if (-1 == opt)
                        break;
@@ -270,6 +272,9 @@ main(int argc, char **argv)
                        case 'K':
                                ssl_options.key_file = optarg;
                                break;
                        case 'K':
                                ssl_options.key_file = optarg;
                                break;
+                       case 'A':
+                               ssl_options.ca_file = optarg;
+                               break;
 
                        case 'h':
                                exit_usage(argv[0], 0);
 
                        case 'h':
                                exit_usage(argv[0], 0);