diff options
author | fiaxh <git@mx.ax.lt> | 2018-01-04 21:13:44 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2018-01-04 21:17:56 +0100 |
commit | a8cc94c188c085e8788e072017ef21d7b7812a55 (patch) | |
tree | f537499e6106144a0b6dd756d25d4d6252f146fe /xmpp-vala/src/core/stanza_reader.vala | |
parent | 6b58b348fa42c3206f56c4b897a255d81f0ea7a9 (diff) | |
download | dino-a8cc94c188c085e8788e072017ef21d7b7812a55.tar.gz dino-a8cc94c188c085e8788e072017ef21d7b7812a55.zip |
Show error on invalid TLS certificate
Diffstat (limited to 'xmpp-vala/src/core/stanza_reader.vala')
-rw-r--r-- | xmpp-vala/src/core/stanza_reader.vala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xmpp-vala/src/core/stanza_reader.vala b/xmpp-vala/src/core/stanza_reader.vala index 4b4d98ab..6a7520ba 100644 --- a/xmpp-vala/src/core/stanza_reader.vala +++ b/xmpp-vala/src/core/stanza_reader.vala @@ -7,12 +7,12 @@ public const string XML_URI = "http://www.w3.org/XML/1998/namespace"; public const string JABBER_URI = "jabber:client"; public errordomain XmlError { - XML_ERROR, NS_DICT_ERROR, UNSUPPORTED, EOF, BAD_XML, - IO_ERROR + IO, + TLS } public class StanzaReader { @@ -52,8 +52,10 @@ public class StanzaReader { buffer_fill = (int) yield ((!)input).read_async(buffer, GLib.Priority.DEFAULT, cancellable); if (buffer_fill == 0) throw new XmlError.EOF("End of input stream reached."); buffer_pos = 0; + } catch (TlsError e) { + throw new XmlError.TLS("TlsError: %s".printf(e.message)); } catch (GLib.IOError e) { - throw new XmlError.IO_ERROR("IOError in GLib: %s".printf(e.message)); + throw new XmlError.IO("GLib.IOError: %s".printf(e.message)); } } |