about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-02-26 03:15:42 +0000
committerJames Booth <boothj5@gmail.com>2012-02-26 03:15:42 +0000
commitd6ac3c3347e948bea3d7bf2f32e5108ee626c1ec (patch)
treea9259e9cccf8a605ac5cd4ea789d8bb32b68cafb
parent400a099edd29d9ac192afece01591554f82626d6 (diff)
downloadprofani-tty-d6ac3c3347e948bea3d7bf2f32e5108ee626c1ec.tar.gz
DIsabling tls on server
-rw-r--r--jabber.c7
-rw-r--r--log.h2
-rw-r--r--roster.c8
3 files changed, 15 insertions, 2 deletions
diff --git a/jabber.c b/jabber.c
index 07e841c8..8f3e5c8e 100644
--- a/jabber.c
+++ b/jabber.c
@@ -21,6 +21,7 @@
  */
 
 #include <string.h>
+#include <strophe.h>
 
 #include "jabber.h"
 #include "log.h"
@@ -80,6 +81,12 @@ int jabber_connect(char *user, char *passwd)
     xmpp_conn_set_jid(_conn, user);
     xmpp_conn_set_pass(_conn, passwd);
 
+    // hack to not attempt tls on framework
+    char *domain = strchr(user, '@');
+    domain++;
+    if (strcmp(domain, "framework") == 0)
+        xmpp_conn_disable_tls(_conn);
+
     int connect_status = xmpp_connect_client(_conn, NULL, 0, _jabber_conn_handler, _ctx);
 
     if (connect_status == 0) {
diff --git a/log.h b/log.h
index c2d4b7e5..51e0994c 100644
--- a/log.h
+++ b/log.h
@@ -25,8 +25,6 @@
 
 #include <stdio.h>
 
-#include <strophe/strophe.h>
-
 // log areas
 #define PROF "prof"
 #define CONN "conn"
diff --git a/roster.c b/roster.c
index 30f14b09..5b42376a 100644
--- a/roster.c
+++ b/roster.c
@@ -156,6 +156,14 @@ int main(int argc, char **argv)
     xmpp_conn_set_pass(conn, argv[2]);
 
     /* initiate connection */
+    char *domain = strchr(argv[1], '@');
+    domain++;
+
+    printf("Domain = %s\n", domain);
+
+    if (strcmp(domain, "framework") == 0)
+        xmpp_conn_disable_tls(conn);
+
     xmpp_connect_client(conn, NULL, 0, conn_handler, ctx);
 
     printf("CONNECT CLIENT CALLED\n");