It was accidentally getting cleared at the wrong time (although the
tls-certificate and tls-errors properties were still correct).
Also add a test for this case.
https://bugzilla.gnome.org/show_bug.cgi?id=665182
if (priv->tls_certificate)
g_object_unref (priv->tls_certificate);
priv->tls_certificate = g_value_dup_object (value);
if (priv->tls_certificate)
g_object_unref (priv->tls_certificate);
priv->tls_certificate = g_value_dup_object (value);
- if (priv->tls_certificate && !priv->tls_errors)
+ if (priv->tls_errors)
+ priv->msg_flags &= ~SOUP_MESSAGE_CERTIFICATE_TRUSTED;
+ else if (priv->tls_certificate)
priv->msg_flags |= SOUP_MESSAGE_CERTIFICATE_TRUSTED;
break;
case PROP_TLS_ERRORS:
priv->msg_flags |= SOUP_MESSAGE_CERTIFICATE_TRUSTED;
break;
case PROP_TLS_ERRORS:
priv->decoders = g_slist_delete_link (priv->decoders, priv->decoders);
}
priv->msg_flags &= ~SOUP_MESSAGE_CONTENT_DECODED;
priv->decoders = g_slist_delete_link (priv->decoders, priv->decoders);
}
priv->msg_flags &= ~SOUP_MESSAGE_CONTENT_DECODED;
- priv->msg_flags &= ~SOUP_MESSAGE_CERTIFICATE_TRUSTED;
req->status_code = SOUP_STATUS_NONE;
if (req->reason_phrase) {
req->status_code = SOUP_STATUS_NONE;
if (req->reason_phrase) {
debug_printf (1, " Response not https\n");
errors++;
}
debug_printf (1, " Response not https\n");
errors++;
}
+ if (soup_message_get_flags (msg) & SOUP_MESSAGE_CERTIFICATE_TRUSTED) {
+ debug_printf (1, " CERTIFICATE_TRUSTED set?\n");
+ errors++;
+ }
debug_printf (1, " tls error flags: 0x%x\n", flags);
}
errors++;
debug_printf (1, " tls error flags: 0x%x\n", flags);
}
errors++;
+ } else if (with_ca_list && SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) {
+ if (!(soup_message_get_flags (msg) & SOUP_MESSAGE_CERTIFICATE_TRUSTED)) {
+ debug_printf (1, " CERTIFICATE_TRUSTED not set?\n");
+ errors++;
+ }
+ } else {
+ if (with_ca_list && soup_message_get_flags (msg) & SOUP_MESSAGE_CERTIFICATE_TRUSTED) {
+ debug_printf (1, " CERTIFICATE_TRUSTED set?\n");
+ errors++;
+ }