[Commits] [SCM] claws branch, master, updated. 3.11.1-136-gbee7378
ticho at claws-mail.org
ticho at claws-mail.org
Wed Jun 17 13:48:58 CEST 2015
The branch, master has been updated
via bee73785e5372679f55faf89bf8abf4ba6311af5 (commit)
from a48d94d8f0c2ea1b4778d1d92c6758433b856c0c (commit)
Summary of changes:
src/plugins/rssyl/libfeed/feed.c | 24 ++++++++++++++++++++++++
src/plugins/rssyl/libfeed/feed.h | 4 ++++
2 files changed, 28 insertions(+)
- Log -----------------------------------------------------------------
commit bee73785e5372679f55faf89bf8abf4ba6311af5
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Wed Jun 17 13:47:01 2015 +0200
RSSyl: Allow giving custom CA cert file to libfeed
diff --git a/src/plugins/rssyl/libfeed/feed.c b/src/plugins/rssyl/libfeed/feed.c
index cd50704..1ddeb44 100644
--- a/src/plugins/rssyl/libfeed/feed.c
+++ b/src/plugins/rssyl/libfeed/feed.c
@@ -52,6 +52,9 @@ Feed *feed_new(gchar *url)
feed->fetcherr = NULL;
feed->cookies_path = NULL;
+ feed->ssl_verify_peer = TRUE;
+ feed->cacert_file = NULL;
+
return feed;
}
@@ -90,6 +93,7 @@ void feed_free(Feed *feed)
g_free(feed->link);
g_free(feed->fetcherr);
g_free(feed->cookies_path);
+ g_free(feed->cacert_file);
if( feed->items != NULL ) {
g_slist_foreach(feed->items, _free_items, NULL);
@@ -302,6 +306,8 @@ guint feed_update(Feed *feed, time_t last_update)
if (feed->ssl_verify_peer == FALSE) {
curl_easy_setopt(eh, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(eh, CURLOPT_SSL_VERIFYHOST, 0);
+ if (feed->cacert_file != NULL)
+ curl_easy_setopt(eh, CURLOPT_CAINFO, feed->cacert_file);
}
#endif
@@ -411,3 +417,21 @@ void feed_set_ssl_verify_peer(Feed *feed, gboolean ssl_verify_peer)
g_return_if_fail(feed != NULL);
feed->ssl_verify_peer = ssl_verify_peer;
}
+
+gchar *feed_get_cacert_file(Feed *feed)
+{
+ g_return_val_if_fail(feed != NULL, NULL);
+ return feed->cacert_file;
+}
+
+void feed_set_cacert_file(Feed *feed, gchar *path)
+{
+ g_return_if_fail(feed != NULL);
+
+ if( feed->cacert_file != NULL ) {
+ g_free(feed->cacert_file);
+ feed->cacert_file = NULL;
+ }
+
+ feed->cacert_file = (path != NULL ? g_strdup(path) : NULL);
+}
diff --git a/src/plugins/rssyl/libfeed/feed.h b/src/plugins/rssyl/libfeed/feed.h
index 5abde34..18c1801 100644
--- a/src/plugins/rssyl/libfeed/feed.h
+++ b/src/plugins/rssyl/libfeed/feed.h
@@ -58,6 +58,7 @@ struct _Feed {
gchar *fetcherr;
gchar *cookies_path;
gboolean ssl_verify_peer;
+ gchar *cacert_file;
GSList *items;
};
@@ -115,6 +116,9 @@ void feed_set_cookies_path(Feed *feed, gchar *path);
gboolean feed_get_ssl_verify_peer(Feed *feed);
void feed_set_ssl_verify_peer(Feed *feed, gboolean ssl_verify_peer);
+gchar *feed_get_cacert_file(Feed *feed);
+void feed_set_cacert_file(Feed *feed, gchar *path);
+
gint feed_n_items(Feed *feed);
FeedItem *feed_nth_item(Feed *feed, guint n);
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list