aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-11-29 16:03:18 +0100
committerfiaxh <git@lightrise.org>2019-11-29 16:03:18 +0100
commitd194eae61d4fda8504a037daa721d9810ed1fe3e (patch)
tree0bca1c934573e7ee1d2528a8355f9297f7cb1f56 /xmpp-vala/src
parent1985fe1d7b94bd1eff80bb3da14bbc52e5585163 (diff)
downloaddino-d194eae61d4fda8504a037daa721d9810ed1fe3e.tar.gz
dino-d194eae61d4fda8504a037daa721d9810ed1fe3e.zip
Set ALPN info on XMPP connections if GIO >= 2.60
Diffstat (limited to 'xmpp-vala/src')
-rw-r--r--xmpp-vala/src/module/xep/0368_srv_records_tls.vala3
1 files changed, 3 insertions, 0 deletions
diff --git a/xmpp-vala/src/module/xep/0368_srv_records_tls.vala b/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
index 3d0708fb..5a2a4559 100644
--- a/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
+++ b/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
@@ -39,6 +39,9 @@ public class TlsConnectionProvider : ConnectionProvider {
debug("Connecting to %s %i (tls)", srv_target.get_hostname(), srv_target.get_port());
IOStream? io_stream = yield client.connect_to_host_async(srv_target.get_hostname(), srv_target.get_port());
TlsConnection tls_connection = TlsClientConnection.new(io_stream, new NetworkAddress(stream.remote_name.to_string(), srv_target.get_port()));
+#if ALPN_SUPPORT
+ tls_connection.set_advertised_protocols(new string[]{"xmpp-client"});
+#endif
tls_connection.accept_certificate.connect(stream.get_module(Tls.Module.IDENTITY).on_invalid_certificate);
stream.add_flag(new Tls.Flag() { finished=true });
return tls_connection;