Re: TLS/SSL support not available on Android even with glib-networking installed



Hi Dan,

My apologies, my experiment hadn't worked because I hadn't done
something else (use rpl to remove versions from required libraries) on
the particular libgiognutls.so file which I used for the experiment.

My problem appears solved if I am able to provide an acceptable
GIO_MODULE_DIR to glib.

On a side note, can GIO_MODULE_DIR contain more than one directory
separated with colons, or just one?

Thanks!
iordan


On Sun, Sep 15, 2013 at 3:34 PM, i iordanov <iiordanov gmail com> wrote:
Hi Dan,

Thanks for the excellent advice. I will try what you're suggesting as
soon as possible. I hope you don't mind if I have questions to ask.

As an alternative, how do you suppose I can enable automatic discovery
of modules by GIO on Android? So far, I've tried changing the
GIO_MODULE_DIR when I build glib to be /sdcard/gio (just as a test, of
course), and I've placed the libgiognutls.so module in /sdcard/gio on
the device. This doesn't seem to work, however. Since you seem well
versed in the order of operations involved in discovering the module,
could you help me understand what other conditions I need to prepare
for the module discovery to work?

Many thanks!
iordan

On Sun, Sep 15, 2013 at 2:57 PM, Dan Winship <danw gnome org> wrote:
On 09/15/2013 02:05 AM, i iordanov wrote:
        System.loadLibrary("giognutls");

And yet, whenever govirt (the library which handles oVirt support)
uses libsoup, it returns an error with the contents:

TLS/SSL support not available; install glib-networking

Even though to my understanding, glib-networking is as "installed" as
I can make it on Android.

Right. gio needs to be told about each module that's available in order
to be able to use them. Normally gio handles this itself when it dlopens
the module, but since you're bypassing that, the module never gets
registered.

If you don't have working gmodule support and can't let gio load the
gnutls module on its own, then you'll have to hack up glib-networking a
bit; change gtlsbackend-gnutls.c to use G_DEFINE_TYPE_EXTENDED (and
G_IMPLEMENT_INTERFACE) at the top, rather than the _DYNAMIC versions of
each, remove the g_type_plugin_use() call in gtls_gnutls_init(), and
remove the GIOModule argument and g_tls_backend_gnutls_register_type()
call from g_tls_backend_gnutls_register(). (And remove gnutls-module.c
entirely.)

Then you need to call g_tls_backend_gnutls_register() from main() or
something, but you have to call it *after* _g_io_modules_ensure_loaded()
is called. That function isn't currently visible outside of glib, so
there's no way for you to call it directly. You could patch glib to make
it be exported, but the easier hack is to just request some *other*
extension point. Eg, call g_vfs_get_default() or
g_proxy_resolver_get_default(), and just ignore the result, and then
call g_tls_backend_gnutls_register().

-- Dan




--
The conscious mind has only one thread of execution.



-- 
The conscious mind has only one thread of execution.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]