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 653645 - During pending establishing connections to SSL-sites lib "fire" error-signals
During pending establishing connections to SSL-sites lib "fire" error-signals
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-06-29 13:38 UTC by Igor Makarov
Modified: 2011-08-25 22:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Cleanup pending connection errors (852 bytes, patch)
2011-06-29 13:39 UTC, Igor Makarov
rejected Details | Review
clean error GNUTLS_E_REHANDSHAKE while establish ssl-connection with client certificate (833 bytes, patch)
2011-06-30 06:25 UTC, Igor Makarov
none Details | Review

Description Igor Makarov 2011-06-29 13:38:37 UTC
During pending establishing connections to SSL-sites lib "fire" error-signals caused by GNUTLS_E_AGAIN and GNUTLS_E_REHANDSHAKE
Comment 1 Igor Makarov 2011-06-29 13:39:39 UTC
Created attachment 190931 [details] [review]
Cleanup pending connection errors
Comment 2 Dan Winship 2011-06-29 14:21:23 UTC
Comment on attachment 190931 [details] [review]
Cleanup pending connection errors

What circumstances are you seeing problems in?

Ignoring GNUTLS_E_AGAIN means that you break non-blocking I/O.

Note that if you have glib-networking 2.28.6, there was a bug that resulted in GErrors being set when no error had occurred, and you should upgrade to 2.28.6.1 or 2.28.7 to fix that.
Comment 3 Igor Makarov 2011-06-29 14:25:09 UTC
These errors occur on sites where required client-certificate auth
Comment 4 Igor Makarov 2011-06-29 14:27:43 UTC
Yes I am using 2.28.6, I'll check this on 2.28.7
Thank you Dan
Comment 5 Igor Makarov 2011-06-29 14:34:47 UTC
Yes I am using 2.28.6, I'll check this on 2.28.7
Thank you Dan
Comment 6 Igor Makarov 2011-06-29 14:51:12 UTC
So, changes from 2.28.6 -> 2.28.6.1 not help, here log of my client program:

(***********): GLib-GObject-WARNING **: Two different plugins tried to register 'GTlsBackendGnutls'.

(***********): GLib-GObject-CRITICAL **: g_type_add_interface_dynamic: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(***********): GLib-GIO-WARNING **: Tried to register an extension of the type (null) to extension point gio-tls-backend. Expected type is GTlsBackend.
>>> [***********] load_commit_cb(): uri=https://xxx.xxx.com/clientssl
>>> [***********] Loading... [ Download your certificate (0%) ]
>>> [***********] Loading... [ Download your certificate (50%) ]
(*) Direct/Interface: Loaded 'PNG' implementation of 'IDirectFBImageProvider'.
>>> [***********] Loading... [ Download your certificate (90%) ]
>>> [***********] load_done_cb() success=1
>>> [***********] Loading... [ Download your certificate (100%) ]
>>> [***********] load_finished_cb() Loading is finished.

(***********): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
The overwriting error message was: Error receiving data: Resource temporarily unavailable
(!) [16836:    0.000] --> Caught signal 11 (at (nil), invalid address) <--
Segmentation fault
Comment 7 Dan Winship 2011-06-29 14:59:19 UTC
(In reply to comment #6)
> So, changes from 2.28.6 -> 2.28.6.1 not help, here log of my client program:
> 
> (***********): GLib-GObject-WARNING **: Two different plugins tried to register
> 'GTlsBackendGnutls'.

That means it's trying to load both the 2.28.6 plugin and the 2.28.6.1 plugin (and presumably the 2.28.6 one is winning).
Comment 8 Igor Makarov 2011-06-30 06:25:59 UTC
Created attachment 190988 [details] [review]
clean error GNUTLS_E_REHANDSHAKE while establish ssl-connection with client certificate

Dear Dan, I find that problem in non-cleaning GNUTLS_E_REHANDSHAKE error.
After applying attached patch my client program working well
Comment 9 Igor Makarov 2011-06-30 19:52:28 UTC
Comment on attachment 190988 [details] [review]
clean error GNUTLS_E_REHANDSHAKE while establish ssl-connection with client certificate

Can anybody review this patch?
Comment 10 Dan Winship 2011-07-01 15:46:27 UTC
The patch looks basically right (although you need the same check in g_tls_connection_gnutls_write() too) but I'm not sure that's exactly how I want to fix it (since it means we're allocating and then immediately freeing an error for no reason). But I want to add some regression tests before changing this code again (since this bug is actually fallout from an earlier bugfix).
Comment 11 Dan Winship 2011-08-25 22:57:11 UTC
Pushed a slightly different patch, and added a test to tls/tests/tls.c
(which ended up revealing a different bug in the server side of
rehandshaking).