GNOME Bugzilla – Bug 668098
It should be possible to cancel a SoupMessage inside a SoupSession::request-started callback
Last modified: 2012-01-18 14:39:35 UTC
Created attachment 205449 [details] [review] Proposed patch. When one is using libsoup and needs to perform certificate validation with the possibility of the user deciding to add other certificates to the current bundle, it is usually not possible to turn the "ssl-strict" SoupSession property on. In this case, the best option would be to let the server and the client perform the TLS handshake and, if the certificate is invalid, cancel the request before any application data is sent. A good way to achieve this is calling soup_session_cancel_message() inside a SoupSession::request-started callback. Right now, this doesn't work as expected, as soup fails an assertion: libsoup-CRITICAL **: soup_connection_send_request: assertion `SOUP_IS_CONNECTION (conn)' failed and soup_connection_send_request() is still called in soup_session_queue_item().
The change to soup-session.c exposed some weirdness in how SoupSession was handling proxy CONNECT messages, which caused proxy-test to break. I updated it to fix those as well, and committed it. Thanks for the patch.