Changeset 164352e for protocols/jabber
- Timestamp:
- 2011-12-24T18:02:39Z (13 years ago)
- Branches:
- master
- Children:
- 34ded90
- Parents:
- e306fbf (diff), 96f954d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols/jabber
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/io.c
re306fbf r164352e 276 276 } 277 277 278 gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition cond )278 gboolean jabber_connected_ssl( gpointer data, int returncode, void *source, b_input_condition cond ) 279 279 { 280 280 struct im_connection *ic = data; … … 292 292 jd->ssl = NULL; 293 293 294 imcb_error( ic, "Could not connect to server" ); 295 imc_logout( ic, TRUE ); 294 if( returncode != 0 ) 295 { 296 char *err = ssl_verify_strerror( returncode ); 297 imcb_error( ic, "Certificate verification problem 0x%x: %s", 298 returncode, err ? err : "Unknown" ); 299 g_free( err ); 300 imc_logout( ic, FALSE ); 301 } 302 else 303 { 304 imcb_error( ic, "Could not connect to server" ); 305 imc_logout( ic, TRUE ); 306 } 307 296 308 return FALSE; 297 309 } … … 397 409 struct im_connection *ic = data; 398 410 struct jabber_data *jd = ic->proto_data; 399 char *xmlns ;411 char *xmlns, *tlsname; 400 412 401 413 xmlns = xt_find_attr( node, "xmlns" ); … … 423 435 424 436 jd->flags |= JFLAG_STARTTLS_DONE; 425 jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic ); 437 438 /* If the user specified a server for the account, use this server as the 439 * hostname in the certificate verification. Else we use the domain from 440 * the username. */ 441 if( ic->acc->server && *ic->acc->server ) 442 tlsname = ic->acc->server; 443 else 444 tlsname = jd->server; 445 446 jd->ssl = ssl_starttls( jd->fd, tlsname, set_getbool( &ic->acc->set, "tls_verify" ), 447 jabber_connected_ssl, ic ); 426 448 427 449 return XT_HANDLED; -
protocols/jabber/jabber.c
re306fbf r164352e 87 87 s = set_add( &acc->set, "tls", "try", set_eval_tls, acc ); 88 88 s->flags |= ACC_SET_OFFLINE_ONLY; 89 89 90 s = set_add( &acc->set, "tls_verify", "true", set_eval_bool, acc ); 91 s->flags |= ACC_SET_OFFLINE_ONLY; 92 90 93 s = set_add( &acc->set, "user_agent", "BitlBee", NULL, acc ); 91 94 … … 228 231 if( set_getbool( &acc->set, "ssl" ) ) 229 232 { 230 jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), jabber_connected_ssl, ic );233 jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), FALSE, jabber_connected_ssl, ic ); 231 234 jd->fd = jd->ssl ? ssl_getfd( jd->ssl ) : -1; 232 235 } -
protocols/jabber/jabber.h
re306fbf r164352e 317 317 int jabber_write( struct im_connection *ic, char *buf, int len ); 318 318 gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond ); 319 gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition cond );319 gboolean jabber_connected_ssl( gpointer data, int returncode, void *source, b_input_condition cond ); 320 320 gboolean jabber_start_stream( struct im_connection *ic ); 321 321 void jabber_end_stream( struct im_connection *ic );
Note: See TracChangeset
for help on using the changeset viewer.