@@ -683,6 +683,7 @@ cmd_ac_init(void)
|
||||
tls_certpath_ac = autocomplete_new();
|
||||
autocomplete_add(tls_certpath_ac, "set");
|
||||
autocomplete_add(tls_certpath_ac, "clear");
|
||||
autocomplete_add(tls_certpath_ac, "default");
|
||||
|
||||
script_ac = autocomplete_new();
|
||||
autocomplete_add(script_ac, "run");
|
||||
|
||||
@@ -200,6 +200,7 @@ static struct cmd_t command_defs[] =
|
||||
"/tls certpath",
|
||||
"/tls certpath set <path>",
|
||||
"/tls certpath clear",
|
||||
"/tls certpath default",
|
||||
"/tls show on|off")
|
||||
CMD_DESC(
|
||||
"Handle TLS certificates. ")
|
||||
@@ -215,6 +216,7 @@ static struct cmd_t command_defs[] =
|
||||
{ "certpath", "Show the trusted certificate path." },
|
||||
{ "certpath set <path>", "Specify filesystem path containing trusted certificates." },
|
||||
{ "certpath clear", "Clear the trusted certificate path." },
|
||||
{ "certpath default", "Use default system certificate path, if it can be found." },
|
||||
{ "show on|off", "Show or hide the TLS indicator in the titlebar." })
|
||||
CMD_NOEXAMPLES
|
||||
},
|
||||
|
||||
@@ -171,14 +171,18 @@ cmd_tls_certpath(ProfWin *window, const char *const command, gchar **args)
|
||||
}
|
||||
return TRUE;
|
||||
} else if (g_strcmp0(args[1], "clear") == 0) {
|
||||
prefs_set_string(PREF_TLS_CERTPATH, NULL);
|
||||
prefs_set_string(PREF_TLS_CERTPATH, "none");
|
||||
cons_show("Certificate path cleared");
|
||||
return TRUE;
|
||||
} else if (g_strcmp0(args[1], "default") == 0) {
|
||||
prefs_set_string(PREF_TLS_CERTPATH, NULL);
|
||||
cons_show("Certificate path defaulted to finding system certpath.");
|
||||
return TRUE;
|
||||
} else if (args[1] == NULL) {
|
||||
char *path = prefs_get_string(PREF_TLS_CERTPATH);
|
||||
char *path = prefs_get_tls_certpath();
|
||||
if (path) {
|
||||
cons_show("Trusted certificate path: %s", path);
|
||||
prefs_free_string(path);
|
||||
free(path);
|
||||
} else {
|
||||
cons_show("No trusted certificate path set.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user