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



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



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