[evolution-data-server] Restore ESourceWebdav:ignore-invalid-cert property.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Restore ESourceWebdav:ignore-invalid-cert property.
- Date: Sat, 12 Jan 2013 19:15:02 +0000 (UTC)
commit 513c3edfc69ceb112ebf75ea36ca20f081066148
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Jan 12 12:08:23 2013 -0500
Restore ESourceWebdav:ignore-invalid-cert property.
Deprecate the property, don't break backward-compatibility.
.../libedataserver/libedataserver-sections.txt | 4 +-
libedataserver/e-source-webdav.c | 78 ++++++++++++++++++++
libedataserver/e-source-webdav.h | 8 ++
3 files changed, 88 insertions(+), 2 deletions(-)
---
diff --git a/docs/reference/libedataserver/libedataserver-sections.txt b/docs/reference/libedataserver/libedataserver-sections.txt
index 8de0ebc..3892d0a 100644
--- a/docs/reference/libedataserver/libedataserver-sections.txt
+++ b/docs/reference/libedataserver/libedataserver-sections.txt
@@ -1009,8 +1009,6 @@ e_source_webdav_set_display_name
e_source_webdav_get_email_address
e_source_webdav_dup_email_address
e_source_webdav_set_email_address
-e_source_webdav_get_ignore_invalid_cert
-e_source_webdav_set_ignore_invalid_cert
e_source_webdav_get_resource_path
e_source_webdav_dup_resource_path
e_source_webdav_set_resource_path
@@ -1021,6 +1019,8 @@ e_source_webdav_dup_soup_uri
e_source_webdav_set_soup_uri
e_source_webdav_get_avoid_ifmatch
e_source_webdav_set_avoid_ifmatch
+e_source_webdav_get_ignore_invalid_cert
+e_source_webdav_set_ignore_invalid_cert
<SUBSECTION Standard>
E_SOURCE_WEBDAV
E_IS_SOURCE_WEBDAV
diff --git a/libedataserver/e-source-webdav.c b/libedataserver/e-source-webdav.c
index 67271c0..5413230 100644
--- a/libedataserver/e-source-webdav.c
+++ b/libedataserver/e-source-webdav.c
@@ -72,6 +72,7 @@ struct _ESourceWebdavPrivate {
gchar *ssl_trust;
gboolean avoid_ifmatch;
gboolean calendar_auto_schedule;
+ gboolean ignore_invalid_cert;
SoupURI *soup_uri;
};
@@ -81,6 +82,7 @@ enum {
PROP_CALENDAR_AUTO_SCHEDULE,
PROP_DISPLAY_NAME,
PROP_EMAIL_ADDRESS,
+ PROP_IGNORE_INVALID_CERT,
PROP_RESOURCE_PATH,
PROP_RESOURCE_QUERY,
PROP_SOUP_URI,
@@ -265,6 +267,12 @@ source_webdav_set_property (GObject *object,
g_value_get_string (value));
return;
+ case PROP_IGNORE_INVALID_CERT:
+ e_source_webdav_set_ignore_invalid_cert (
+ E_SOURCE_WEBDAV (object),
+ g_value_get_boolean (value));
+ return;
+
case PROP_RESOURCE_PATH:
e_source_webdav_set_resource_path (
E_SOURCE_WEBDAV (object),
@@ -328,6 +336,13 @@ source_webdav_get_property (GObject *object,
E_SOURCE_WEBDAV (object)));
return;
+ case PROP_IGNORE_INVALID_CERT:
+ g_value_set_boolean (
+ value,
+ e_source_webdav_get_ignore_invalid_cert (
+ E_SOURCE_WEBDAV (object)));
+ return;
+
case PROP_RESOURCE_PATH:
g_value_take_string (
value,
@@ -510,6 +525,18 @@ e_source_webdav_class_init (ESourceWebdavClass *class)
g_object_class_install_property (
object_class,
+ PROP_IGNORE_INVALID_CERT,
+ g_param_spec_boolean (
+ "ignore-invalid-cert",
+ "Ignore Invalid Cert",
+ "Ignore invalid SSL certificates",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ E_SOURCE_PARAM_SETTING));
+
+ g_object_class_install_property (
+ object_class,
PROP_RESOURCE_PATH,
g_param_spec_string (
"resource-path",
@@ -843,6 +870,57 @@ e_source_webdav_set_email_address (ESourceWebdav *extension,
}
/**
+ * e_source_webdav_get_ignore_invalid_cert:
+ * @extension: an #ESourceWebdav
+ *
+ * Returns %TRUE if invalid SSL certificates should be ignored.
+ *
+ * This option allows SSL certificates to be accepted even if they have
+ * signed by an unrecognized Certificate Authority.
+ *
+ * Returns: whether invalid SSL certificates should be ignored
+ *
+ * Since: 3.6
+ *
+ * Deprecated: 3.8: The trust prompt APIs replace this.
+ **/
+gboolean
+e_source_webdav_get_ignore_invalid_cert (ESourceWebdav *extension)
+{
+ g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), FALSE);
+
+ return extension->priv->ignore_invalid_cert;
+}
+
+/**
+ * e_source_webdav_set_ignore_invalid_cert:
+ * @extension: an #ESourceWebdav
+ * @ignore_invalid_cert: whether invalid SSL certificates should be ignored
+ *
+ * Sets whether invalid SSL certificates should be ignored.
+ *
+ * This option allows SSL certificates to be accepted even if they have
+ * signed by an unrecognized Certificate Authority.
+ *
+ * Since: 3.6
+ *
+ * Deprecated: 3.8: The trust prompt APIs replace this.
+ **/
+void
+e_source_webdav_set_ignore_invalid_cert (ESourceWebdav *extension,
+ gboolean ignore_invalid_cert)
+{
+ g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
+
+ if (extension->priv->ignore_invalid_cert == ignore_invalid_cert)
+ return;
+
+ extension->priv->ignore_invalid_cert = ignore_invalid_cert;
+
+ g_object_notify (G_OBJECT (extension), "ignore-invalid-cert");
+}
+
+/**
* e_source_webdav_get_resource_path:
* @extension: an #ESourceWebdav
*
diff --git a/libedataserver/e-source-webdav.h b/libedataserver/e-source-webdav.h
index fce6907..93cd8c5 100644
--- a/libedataserver/e-source-webdav.h
+++ b/libedataserver/e-source-webdav.h
@@ -142,6 +142,14 @@ void e_source_webdav_store_ssl_trust_prompt
void e_source_webdav_unset_temporary_ssl_trust
(ESourceWebdav *extension);
+#ifndef EDS_DISABLE_DEPRECATED
+gboolean e_source_webdav_get_ignore_invalid_cert
+ (ESourceWebdav *extension);
+void e_source_webdav_set_ignore_invalid_cert
+ (ESourceWebdav *extension,
+ gboolean ignore_invalid_cert);
+#endif /* EDS_DISABLE_DEPRECATED */
+
G_END_DECLS
#endif /* E_SOURCE_WEBDAV_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]