aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/core/tls_xmpp_stream.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-12-31 19:00:54 +0100
committerfiaxh <git@lightrise.org>2020-12-31 19:04:02 +0100
commit81a55052707d460a7f437b664682817c2c99dce6 (patch)
tree0d2b184a98d5a62d47beb2a4a09a13a4ea6e12a4 /xmpp-vala/src/core/tls_xmpp_stream.vala
parent99e98ac8d97296b0a34351d3bc8b155b0c8fc6db (diff)
downloaddino-81a55052707d460a7f437b664682817c2c99dce6.tar.gz
dino-81a55052707d460a7f437b664682817c2c99dce6.zip
Allow certificates from unknown CAs from .onion domains
It's barely possible for .onion servers to provide a non-self-signed cert. But that's fine because encryption is provided independently though TOR. see #958
Diffstat (limited to 'xmpp-vala/src/core/tls_xmpp_stream.vala')
-rw-r--r--xmpp-vala/src/core/tls_xmpp_stream.vala8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmpp-vala/src/core/tls_xmpp_stream.vala b/xmpp-vala/src/core/tls_xmpp_stream.vala
index 956a9a22..f47b3c80 100644
--- a/xmpp-vala/src/core/tls_xmpp_stream.vala
+++ b/xmpp-vala/src/core/tls_xmpp_stream.vala
@@ -2,6 +2,12 @@ public abstract class Xmpp.TlsXmppStream : IoXmppStream {
public TlsCertificateFlags? errors;
+ public delegate bool OnInvalidCert(GLib.TlsConnection conn, GLib.TlsCertificate peer_cert, GLib.TlsCertificateFlags errors);
+
+ protected TlsXmppStream(Jid remote_name) {
+ base(remote_name);
+ }
+
protected bool on_invalid_certificate(TlsCertificate peer_cert, TlsCertificateFlags errors) {
this.errors = errors;
@@ -13,7 +19,7 @@ public abstract class Xmpp.TlsXmppStream : IoXmppStream {
error_str += @"$(f), ";
}
}
- warning(@"Tls Certificate Errors: $(error_str)");
+ warning(@"[%p, %s] Tls Certificate Errors: %s", this, this.remote_name, error_str);
return false;
}
} \ No newline at end of file