} State;
typedef struct {
- time_t cookie_timeout;
- int scrollstep;
- char *home_page;
- char *download_dir;
- guint history_max;
- char *editor_command;
- guint timeoutlen; /* timeout for ambiguous mappings */
- gboolean strict_focus;
- GHashTable *headers; /* holds user defined header appended to requests */
- char *nextpattern; /* regex patter nfor prev link matching */
- char *prevpattern; /* regex patter nfor next link matching */
- char *file; /* path to the custome config file */
- char *autocmd; /* command given by --cmd option */
+ time_t cookie_timeout;
+ int scrollstep;
+ char *home_page;
+ char *download_dir;
+ guint history_max;
+ char *editor_command;
+ guint timeoutlen; /* timeout for ambiguous mappings */
+ gboolean strict_focus;
+ GHashTable *headers; /* holds user defined header appended to requests */
+ char *nextpattern; /* regex patter nfor prev link matching */
+ char *prevpattern; /* regex patter nfor next link matching */
+ char *file; /* path to the custome config file */
+ char *autocmd; /* command given by --cmd option */
+ char *cafile; /* path to the ca file */
+ GTlsDatabase *tls_db; /* tls database */
} Config;
typedef struct {
static SettingStatus ca_bundle(const Setting *s, const SettingType type)
{
- char *value;
if (type == SETTING_GET) {
- g_object_get(vb.session, "ssl-ca-file", &value, NULL);
- print_value(s, value);
- g_free(value);
+ print_value(s, vb.config.cafile);
} else {
- g_object_set(vb.session, "ssl-ca-file", s->arg.s, NULL);
+ GError *error = NULL;
+ vb.config.tls_db = g_tls_file_database_new(s->arg.s, &error);
+ if (error) {
+ g_warning("Could not load ssl database '%s': %s", s->arg.s, error->message);
+ g_error_free(error);
+
+ return SETTING_ERROR;
+ }
+
+ /* there is no function to get the file back from tls file database so
+ * it's saves as seperate configuration */
+ OVERWRITE_STRING(vb.config.cafile, s->arg.s);
+ g_object_set(vb.session, "tls-database", vb.config.tls_db, NULL);
}
return SETTING_OK;