m4_define([gdk_encoded_version], [GDK_VERSION_3_2])
dnl Keep these two definitions in agreement.
-m4_define([soup_minimum_version], [2.38.1])
-m4_define([soup_encoded_version], [SOUP_VERSION_2_38])
+m4_define([soup_minimum_version], [2.40.3])
+m4_define([soup_encoded_version], [SOUP_VERSION_2_40])
m4_define([gcr_minimum_version], [3.4])
m4_define([libsecret_minimum_version], [0.5])
g_return_val_if_fail (
prompter != NULL, E_TRUST_PROMPT_RESPONSE_UNKNOWN);
- /* Just a workaround for libsoup bug about not providing connection
- * certificate on failed requests. This is fixed in libsoup since
- * 2.41.3, but let's have this for now. I wrote it here to avoid
- * code duplication, and once the libsoup 2.42.0 will be out all
- * this code, together with other SOUP_CHECK_VERSION usages also
- * in evolution, will be removed. */
- if (!e_named_parameters_get (parameters, "cert")) {
- GList *button_captions = NULL;
- const gchar *markup;
- gchar *tmp = NULL;
-
- button_captions = g_list_append (
- button_captions, _("_Reject"));
- button_captions = g_list_append (
- button_captions, _("Accept _Temporarily"));
- button_captions = g_list_append (
- button_captions, _("_Accept Permanently"));
-
- markup = e_named_parameters_get (parameters, "markup");
- if (!markup) {
- const gchar *host;
- gchar *bhost;
-
- host = e_named_parameters_get (parameters, "host");
- bhost = g_strconcat ("<b>", host, "</b>", NULL);
- tmp = g_strdup_printf (
- _("SSL certificate for '%s' is not trusted. "
- "Do you wish to accept it?"), bhost);
- g_free (bhost);
-
- markup = tmp;
- }
-
- response = e_user_prompter_prompt_sync (
- prompter, "question", _("Certificate trust..."),
- markup, NULL, TRUE, button_captions, cancellable, NULL);
-
- if (response == 1)
- response = 2;
- else if (response == 2)
- response = 1;
-
- g_list_free (button_captions);
- g_free (tmp);
- } else {
- response = e_user_prompter_extension_prompt_sync (
- prompter, "ETrustPrompt::trust-prompt",
- parameters, NULL, cancellable, error);
- }
+ response = e_user_prompter_extension_prompt_sync (
+ prompter, "ETrustPrompt::trust-prompt",
+ parameters, NULL, cancellable, error);
if (response == 0)
return E_TRUST_PROMPT_RESPONSE_REJECT;
if (message->status_code != SOUP_STATUS_SSL_FAILED)
return E_TRUST_PROMPT_RESPONSE_REJECT;
- if (!soup_message_get_https_status (message, &cert, &cert_errors) || !cert) {
- /* Before libsoup 2.41.3 the certificate was not set on
- * failed requests, thus workaround this and do a simple
- * prompt later. */
-#ifdef SOUP_CHECK_VERSION
-#if SOUP_CHECK_VERSION(2, 41, 3)
+ if (!soup_message_get_https_status (message, &cert, &cert_errors) || !cert)
return E_TRUST_PROMPT_RESPONSE_REJECT;
-#endif
-#endif
- }
soup_uri = soup_message_get_uri (message);
if (soup_uri_get_host (soup_uri) == NULL)
return E_TRUST_PROMPT_RESPONSE_REJECT;
-#ifdef SOUP_CHECK_VERSION
-#if SOUP_CHECK_VERSION(2, 41, 3)
g_return_val_if_fail (cert != NULL, E_TRUST_PROMPT_RESPONSE_REJECT);
g_object_get (cert, "certificate", &bytes, NULL);
-#else
- bytes = g_byte_array_new ();
- g_byte_array_append (bytes, (guint8 *) "1", 1);
-#endif
-#else
- bytes = g_byte_array_new ();
- g_byte_array_append (bytes, (guint8 *) "1", 1);
-#endif
if (bytes == NULL)
return E_TRUST_PROMPT_RESPONSE_REJECT;
if (message->status_code != SOUP_STATUS_SSL_FAILED)
return;
- if (!soup_message_get_https_status (message, &cert, NULL) || !cert) {
- /* before libsoup 2.41.3 the certificate was not set on failed requests,
- * thus workaround this and store only simple value
- */
- #ifdef SOUP_CHECK_VERSION
- #if SOUP_CHECK_VERSION(2, 41, 3)
+ if (!soup_message_get_https_status (message, &cert, NULL) || !cert)
return;
- #endif
- #endif
- }
soup_uri = soup_message_get_uri (message);
if (!soup_uri || !soup_uri_get_host (soup_uri))
return;
- #ifdef SOUP_CHECK_VERSION
- #if SOUP_CHECK_VERSION(2, 41, 3)
g_return_if_fail (cert != NULL);
g_object_get (cert, "certificate", &bytes, NULL);
- #else
- bytes = g_byte_array_new ();
- g_byte_array_append (bytes, (guint8 *) "1", 1);
- #endif
- #else
- bytes = g_byte_array_new ();
- g_byte_array_append (bytes, (guint8 *) "1", 1);
- #endif
if (!bytes)
return;