After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 668098 - It should be possible to cancel a SoupMessage inside a SoupSession::request-started callback
It should be possible to cancel a SoupMessage inside a SoupSession::request-s...
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
unspecified
Other All
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-01-17 14:42 UTC by Raphael Kubo da Costa
Modified: 2012-01-18 14:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch. (2.38 KB, patch)
2012-01-17 14:42 UTC, Raphael Kubo da Costa
none Details | Review

Description Raphael Kubo da Costa 2012-01-17 14:42:48 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().
Comment 1 Dan Winship 2012-01-18 14:39:35 UTC
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.