about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/connection.c16
-rw-r--r--src/xmpp/xmpp.h4
2 files changed, 20 insertions, 0 deletions
diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c
index 27711a4c..2986b0bc 100644
--- a/src/xmpp/connection.c
+++ b/src/xmpp/connection.c
@@ -392,8 +392,24 @@ _connection_certfail_cb(const char *const certname, const char *const certfp,
 {
     return sv_ev_certfail(errormsg, certname, certfp, notbefore, notafter);
 }
+
+char*
+jabber_get_tls_peer_cert(void)
+{
+    return xmpp_conn_tls_peer_cert(jabber_conn.conn);
+}
 #endif
 
+gboolean
+jabber_conn_is_secured(void)
+{
+    if (jabber_conn.conn_status == JABBER_CONNECTED) {
+        return xmpp_conn_is_secured(jabber_conn.conn) == 0 ? FALSE : TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
 static jabber_conn_status_t
 _jabber_connect(const char *const fulljid, const char *const passwd,
     const char *const altdomain, int port, const char *const tls_policy)
diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h
index d49b106d..00f83d3f 100644
--- a/src/xmpp/xmpp.h
+++ b/src/xmpp/xmpp.h
@@ -152,6 +152,10 @@ char* jabber_get_account_name(void);
 GList* jabber_get_available_resources(void);
 char* jabber_create_uuid(void);
 void jabber_free_uuid(char *uuid);
+#ifdef HAVE_LIBMESODE
+char* jabber_get_tls_peer_cert(void);
+#endif
+gboolean jabber_conn_is_secured(void);
 
 // message functions
 char* message_send_chat(const char *const barejid, const char *const msg);