Changeset 2094
- Timestamp:
- Jul 1, 2008 3:31:59 PM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2074 r2094 207 207 puts (" --tls-verify-client Verify client's certificate (default=no)"); 208 208 puts (" --tls-neg-timeout Specify TLS negotiation timeout (default=no)"); 209 puts (" --tls-srv-name Specify TLS server name for multi-hosting server (optional)"); 209 210 210 211 puts (""); … … 461 462 OPT_USE_TLS, OPT_TLS_CA_FILE, OPT_TLS_CERT_FILE, OPT_TLS_PRIV_FILE, 462 463 OPT_TLS_PASSWORD, OPT_TLS_VERIFY_SERVER, OPT_TLS_VERIFY_CLIENT, 463 OPT_TLS_NEG_TIMEOUT, 464 OPT_TLS_NEG_TIMEOUT, OPT_TLS_SRV_NAME, 464 465 OPT_CAPTURE_DEV, OPT_PLAYBACK_DEV, 465 466 OPT_CAPTURE_LAT, OPT_PLAYBACK_LAT, OPT_NO_TONES, … … 552 553 { "tls-verify-client", 0, 0, OPT_TLS_VERIFY_CLIENT}, 553 554 { "tls-neg-timeout", 1, 0, OPT_TLS_NEG_TIMEOUT}, 555 { "tls-srv-name", 1, 0, OPT_TLS_SRV_NAME}, 554 556 { "capture-dev", 1, 0, OPT_CAPTURE_DEV}, 555 557 { "playback-dev", 1, 0, OPT_PLAYBACK_DEV}, … … 1137 1139 break; 1138 1140 1141 case OPT_TLS_SRV_NAME: 1142 cfg->udp_cfg.tls_setting.server_name = pj_str(pj_optarg); 1143 break; 1144 1139 1145 case OPT_CAPTURE_DEV: 1140 1146 cfg->capture_dev = atoi(pj_optarg); … … 1469 1475 (int)config->udp_cfg.tls_setting.password.slen, 1470 1476 config->udp_cfg.tls_setting.password.ptr); 1477 pj_strcat2(&cfg, line); 1478 } 1479 1480 if (config->udp_cfg.tls_setting.server_name.slen) { 1481 pj_ansi_sprintf(line, "--tls-srv-name %.*s\n", 1482 (int)config->udp_cfg.tls_setting.server_name.slen, 1483 config->udp_cfg.tls_setting.server_name.ptr); 1471 1484 pj_strcat2(&cfg, line); 1472 1485 } -
pjproject/trunk/pjsip/include/pjsip/sip_transport_tls.h
r2039 r2094 108 108 */ 109 109 pj_str_t ciphers; 110 111 /** 112 * Optionally specify the server name instance to be contacted when 113 * making outgoing TLS connection. This setting is useful when the 114 * server is hosting multiple domains for the same TLS listening 115 * socket. 116 * 117 * Default: empty. 118 */ 119 pj_str_t server_name; 110 120 111 121 /** -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c
r2039 r2094 165 165 /* TLS settings, copied from listener */ 166 166 struct { 167 pj_str_t server_name; 167 168 pj_time_val timeout; 168 169 } setting; … … 513 514 if (!SSL_in_connect_init(ssl)) 514 515 SSL_set_connect_state(ssl); 516 517 #ifdef SSL_set_tlsext_host_name 518 if (tls->setting.server_name.slen) { 519 char server_name[PJ_MAX_HOSTNAME]; 520 521 if (tls->setting.server_name.slen >= PJ_MAX_HOSTNAME) 522 return PJ_ENAMETOOLONG; 523 524 pj_memcpy(server_name, tls->setting.server_name.ptr, 525 tls->setting.server_name.slen); 526 server_name[tls->setting.server_name.slen] = '\0'; 527 528 if (!SSL_set_tlsext_host_name(ssl, server_name)) { 529 PJ_LOG(4,(tls->base.obj_name, 530 "SSL_set_tlsext_host_name() failed")); 531 } 532 } 533 #endif 515 534 516 535 PJ_LOG(5,(tls->base.obj_name, "Starting SSL_connect() negotiation")); … … 1232 1251 tls->base.pool = pool; 1233 1252 tls->setting.timeout = listener->setting.timeout; 1253 pj_strdup(pool, &tls->setting.server_name, 1254 &listener->setting.server_name); 1234 1255 1235 1256 pj_ansi_snprintf(tls->base.obj_name, PJ_MAX_OBJ_NAME,
Note: See TracChangeset
for help on using the changeset viewer.