GNOME Bugzilla – Bug 598852
Implementation of GTLSConnection
Last modified: 2009-10-22 08:13:42 UTC
Created attachment 145738 [details] Corrections to gtls.c/h and renamed to gtlsconnection.? In the old GNIO git repositories* I found an outdated implementation of a GTLSConnection in files named gtls.c and gtls.h. A problem with this implementation is that it assumes GIOStream to be an interface and that it returns (and assumes) a caller-owns reference for the get_input_stream and get_output_stream functions. I have ported this a bit so that it again works against a typical IMAP server (the examples/client.c in the GNIO git repositories tries to connect, using the GTLSConnection, to an IMAP server) I guess Ryan Lorty was the first to make the GTLSConnection class, perhaps the reviewer of this stuff should get in touch with Ryan to check whether I adapted everything correctly. I'm attaching this as as-is because I first want to know whether this kind of functionality is desired in GLib/GIO. If the answer is yes, then I'll rework into a proper patch with checks in GLib's configure.in for GnuTLS (which is probably why it was not picked from the GNIO git repositories in the first place). * http://sciyoshi.com/projects/gnio/
Created attachment 145739 [details] Example for use with gtlsconnection cd glib/gio/tests vi Makefile.am Add these: imap_INCLUDES = `pkg-config gnutls --cflags` imap_SOURCES = client.c gtlsconnection.c gtlsconnection.h imap_LDADD = $(progs_ldadd) $(top_builddir)/gthread/libgthread-2.0.la imap_LDFLAGS = `pkg-config gnutls --libs` Copy gtlsconnection.c and gtlsconnection.h from the tar in glib/gio/tests make imap ./imap 21 bytes read: * OK Dovecot ready. 33 bytes read: a OK Begin TLS negotiation now. ** (process:6953): DEBUG: awesome!! TLS worked out. 164 bytes read: * CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS AUTH=PLAIN a OK Capability completed.
Hello Philip, I think we can mark this as duplicate of bug #588189, of course revert the duplication if you want. *** This bug has been marked as a duplicate of bug 588189 ***
Agree