Ticket #1: patch_1_fix_s2s.2.patch
| File patch_1_fix_s2s.2.patch, 2.5 KB (added by Simon, 8 months ago) |
|---|
-
s2s/in.c
139 139 xhash_put(s2s->in_accept, pstrdup(xhash_pool(s2s->in_accept),ipport), (void *) in); 140 140 141 141 #ifdef HAVE_SSL 142 sx_server_init(in->s, S2S_DB_HEADER | ((s2s-> local_pemfile!= NULL) ? SX_SSL_STARTTLS_OFFER : 0) );142 sx_server_init(in->s, S2S_DB_HEADER | ((s2s->sx_ssl != NULL) ? SX_SSL_STARTTLS_OFFER : 0) ); 143 143 #else 144 144 sx_server_init(in->s, S2S_DB_HEADER); 145 145 #endif -
s2s/out.c
283 283 284 284 #ifdef HAVE_SSL 285 285 /* Send a stream version of 1.0 if we can do STARTTLS */ 286 if(out->s2s->sx_ssl != NULL && out->s2s->local_pemfile != NULL) {286 if(out->s2s->sx_ssl != NULL) { 287 287 sx_client_init(out->s, S2S_DB_HEADER, uri_SERVER, pkt->to->domain, pkt->from->domain, "1.0"); 288 288 } else { 289 289 sx_client_init(out->s, S2S_DB_HEADER, uri_SERVER, NULL, NULL, NULL); … … 617 617 618 618 /* if no stream version from either side, kick off dialback for each route, */ 619 619 /* otherwise wait for stream features */ 620 if ((out->s->res_version==NULL) || (out->s2s->sx_ssl == NULL) || (out->s2s->local_pemfile == NULL)) {620 if ((out->s->res_version==NULL) || (out->s2s->sx_ssl == NULL)) { 621 621 log_debug(ZONE, "no stream version, sending dialbacks for %s immediately", out->key); 622 622 out->online = 1; 623 623 send_dialbacks(out); … … 643 643 644 644 #ifdef HAVE_SSL 645 645 /* starttls if we can */ 646 if(out->s2s->sx_ssl != NULL && out->s2s->local_pemfile != NULL &&s->ssf == 0) {646 if(out->s2s->sx_ssl != NULL && s->ssf == 0) { 647 647 ns = nad_find_scoped_namespace(nad, uri_TLS, NULL); 648 648 if(ns >= 0) { 649 649 elem = nad_find_elem(nad, 0, ns, "starttls", 1); 650 650 if(elem >= 0) { 651 651 log_debug(ZONE, "got STARTTLS in stream features"); 652 if(sx_ssl_client_starttls(out->s2s->sx_ssl, s, out->s2s->local_pemfile) == 0) {652 if(sx_ssl_client_starttls(out->s2s->sx_ssl, s, NULL) == 0) { 653 653 starttls = 1; 654 654 nad_free(nad); 655 655 return 0;
