diff --git a/modules/cal-config-caldav/e-caldav-chooser.c b/modules/cal-config-caldav/e-caldav-chooser.c
index 99017b8..f9b1132 100644
--- a/modules/cal-config-caldav/e-caldav-chooser.c
+++ b/modules/cal-config-caldav/e-caldav-chooser.c
@@ -1417,7 +1417,8 @@ caldav_chooser_try_password_sync (ESourceAuthenticator *auth,
 	g_object_set (session, SOUP_SESSION_SSL_STRICT, TRUE, NULL);
 	g_object_set (chooser->priv->session, SOUP_SESSION_SSL_STRICT, TRUE, NULL);
 
-	if (soup_session_send_message (session, message) == SOUP_STATUS_SSL_FAILED) {
+	soup_session_send_message (session, message);
+	while (message->status_code == SOUP_STATUS_SSL_FAILED) {
 		ETrustPromptResponse response;
 		ENamedParameters *parameters;
 
@@ -1437,9 +1438,22 @@ caldav_chooser_try_password_sync (ESourceAuthenticator *auth,
 			g_object_set (session, SOUP_SESSION_SSL_STRICT, FALSE, NULL);
 			g_object_set (chooser->priv->session, SOUP_SESSION_SSL_STRICT, FALSE, NULL);
 			soup_session_send_message (session, message);
+
+			if (SOUP_STATUS_IS_SUCCESSFUL (message->status_code) &&
+			    !e_source_webdav_ssl_trust_matches (extension, message))
+				soup_message_set_status (message, SOUP_STATUS_SSL_FAILED);
+			else
+				break;
+		} else {
+			break;
 		}
 	}
 
+	if (message->status_code == SOUP_STATUS_SSL_FAILED) {
+		g_object_set (session, SOUP_SESSION_SSL_STRICT, TRUE, NULL);
+		g_object_set (chooser->priv->session, SOUP_SESSION_SSL_STRICT, TRUE, NULL);
+	}
+
 	if (cancel_id > 0)
 		g_cancellable_disconnect (cancellable, cancel_id);
 
