aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src')
-rw-r--r--xmpp-vala/src/core/stanza_reader.vala2
-rw-r--r--xmpp-vala/src/core/xmpp_stream.vala8
-rw-r--r--xmpp-vala/src/module/xep/0368_srv_records_tls.vala12
3 files changed, 14 insertions, 8 deletions
diff --git a/xmpp-vala/src/core/stanza_reader.vala b/xmpp-vala/src/core/stanza_reader.vala
index 0079dc38..f4b900d1 100644
--- a/xmpp-vala/src/core/stanza_reader.vala
+++ b/xmpp-vala/src/core/stanza_reader.vala
@@ -54,8 +54,6 @@ public class StanzaReader {
buffer_pos = 0;
} catch (GLib.IOError e) {
throw new XmlError.IO_ERROR("IOError in GLib: %s".printf(e.message));
- } catch (GLib.TlsError e) {
- throw new XmlError.IO_ERROR("TlsError in GLib: %s".printf(e.message));
}
}
diff --git a/xmpp-vala/src/core/xmpp_stream.vala b/xmpp-vala/src/core/xmpp_stream.vala
index 9d700b4d..0a1f4120 100644
--- a/xmpp-vala/src/core/xmpp_stream.vala
+++ b/xmpp-vala/src/core/xmpp_stream.vala
@@ -360,8 +360,12 @@ public class StartTlsConnectionProvider : ConnectionProvider {
}
public override IOStream? connect(XmppStream stream) {
- SocketClient client = new SocketClient();
- return client.connect_to_host(srv_target.get_hostname(), srv_target.get_port());
+ try {
+ SocketClient client = new SocketClient();
+ return client.connect_to_host(srv_target.get_hostname(), srv_target.get_port());
+ } catch (Error e) {
+ return null;
+ }
}
public override string get_id() { return "start_tls"; }
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 154e8a4f..4c24c63e 100644
--- a/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
+++ b/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
@@ -37,10 +37,14 @@ public class TlsConnectionProvider : ConnectionProvider {
public override IOStream? connect(XmppStream stream) {
SocketClient client = new SocketClient();
- IOStream? io_stream = client.connect_to_host(srv_target.get_hostname(), srv_target.get_port());
- io_stream = TlsClientConnection.new(io_stream, new NetworkAddress(srv_target.get_hostname(), srv_target.get_port()));
- stream.add_flag(new Tls.Flag() { finished=true });
- return io_stream;
+ try {
+ IOStream? io_stream = client.connect_to_host(srv_target.get_hostname(), srv_target.get_port());
+ io_stream = TlsClientConnection.new(io_stream, new NetworkAddress(srv_target.get_hostname(), srv_target.get_port()));
+ stream.add_flag(new Tls.Flag() { finished=true });
+ return io_stream;
+ } catch (Error e) {
+ return null;
+ }
}
public override string get_id() { return "start_tls"; }