comparison src/ssl-gnutls.c @ 6764:6d0d4e9149b9

[gaim-migrate @ 7296] well, jabber.org is being a pain in the moment, as is my server. but this seems to work, so here it is. Jabber SSL support. Make sure you set the port to 5223 and check the "Use SSL" checkbox in the account editor. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 06 Sep 2003 16:04:41 +0000
parents 424647996866
children
comparison
equal deleted inserted replaced
6763:362e60e7c265 6764:6d0d4e9149b9
58 58
59 gnutls_certificate_free_credentials(xcred); 59 gnutls_certificate_free_credentials(xcred);
60 } 60 }
61 61
62 static void 62 static void
63 input_func(gpointer data, gint source, GaimInputCondition cond)
64 {
65 GaimSslConnection *gsc = (GaimSslConnection *)data;
66
67 gaim_debug_misc("gnutls", "In input_func\n");
68
69 gsc->input_func(gsc->user_data, gsc, cond);
70 }
71
72 static void
73 ssl_gnutls_connect_cb(gpointer data, gint source, GaimInputCondition cond) 63 ssl_gnutls_connect_cb(gpointer data, gint source, GaimInputCondition cond)
74 { 64 {
75 GaimSslConnection *gsc = (GaimSslConnection *)data; 65 GaimSslConnection *gsc = (GaimSslConnection *)data;
76 GaimSslGnutlsData *gnutls_data; 66 GaimSslGnutlsData *gnutls_data;
77 static const int cert_type_priority[2] = { GNUTLS_CRT_X509, 0 }; 67 static const int cert_type_priority[2] = { GNUTLS_CRT_X509, 0 };
101 91
102 if (ret < 0) 92 if (ret < 0)
103 { 93 {
104 gaim_debug_error("gnutls", "Handshake failed\n"); 94 gaim_debug_error("gnutls", "Handshake failed\n");
105 95
96 /* XXX: notify the guy expecting the callback somehow? */
106 gaim_ssl_close(gsc); 97 gaim_ssl_close(gsc);
107 } 98 }
108 else 99 else
109 { 100 {
110 gaim_debug_info("gnutls", "Adding input handler.\n"); 101 gsc->connect_cb(gsc->connect_cb_data, gsc, cond);
111 gsc->inpa = gaim_input_add(gsc->fd,
112 GAIM_INPUT_READ | GAIM_INPUT_WRITE,
113 input_func, gsc);
114 } 102 }
115 } 103 }
116 104
117 static void 105 static void
118 ssl_gnutls_close(GaimSslConnection *gsc) 106 ssl_gnutls_close(GaimSslConnection *gsc)