Hi,
as Daf mentioned, some of the new features included in
Loudmouth 1.3.2
release are support for StartTLS, and SRV record lookup.
We've been careful to stay API/ABI compatible with the
previous
releases of LM, but tried to nicely integrate the new
features so
you can use them with minimal modification to existing
apps.
To enable SRV lookups, just don't specify the server, either
in
lm_connection_new() or lm_connection_set_server(). Previous
versions
of LM gave a warning when you tried to call
lm_connection_open()
without specifying a server, while 1.3.2 will attempt to do
a SRV
lookup. Failing that, it will use the domain portion of JID
as
the server name.
So, for example, you don't need to set up server for GTalk
(because
Google Talk servers have SRV records set up), or Jabber.org
(which
doesn't have SRV, but JIDs like 'user jabber.org' will fall-back
to
server 'jabber.org', which is correct).
To use StartTLS, you do need a few extra steps. First, you
have to
create LmSSL object, regardless of whether you're using
old-style
SSL (to port 5223) or StartTLS. The only change is, if you
want
to use StartTLS, after creating the LmSSL object, you should
call:
lm_ssl_use_starttls(gboolean use, gboolean require);
The 'require' param specifies whether you want to *require*
StartTLS,
that is, fail on servers which don't support it, or just
continue
using plaintext on those servers. Note that once Loudmouth
detects
StartTLS support on server and tries to negotiate it, if it
doesn't
succeed, the connection will always fail.
To provide a working example, I've made a quick patch for
Gossip
(0.27) to make use of these features. As I'm not a gossip
dev, please
forgive me on any source code atrocities I might have
commited
in the process
You can find the patch here:
http://projects.collabora.co.uk/~pt
lo/lemur/output/gossip0.27-lm1.3.diff.html
Regards,
Senko
--
Senko Rasic at Collabora <senko.rasic collabora.co.uk>
_______________________________________________
Loudmouth mailing list
Loudmouth lists.imendio.com
h
ttp://lists.imendio.com/mailman/listinfo/loudmouth
|