Changeset 4968
- Timestamp:
- Dec 18, 2014 4:40:35 AM (10 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/ssl_sock.h
r4862 r4968 488 488 /** 489 489 * Enumeration of secure socket protocol types. 490 * This can be combined using bitwise OR operation. 490 491 */ 491 492 typedef enum pj_ssl_sock_proto 492 493 { 493 PJ_SSL_SOCK_PROTO_DEFAULT, /**< Default protocol of backend. */ 494 PJ_SSL_SOCK_PROTO_TLS1, /**< TLSv1.0 protocol. */ 495 PJ_SSL_SOCK_PROTO_SSL3, /**< SSLv3.0 protocol. */ 496 PJ_SSL_SOCK_PROTO_SSL23, /**< SSLv3.0 but can roll back to 497 SSLv2.0. */ 498 PJ_SSL_SOCK_PROTO_SSL2, /**< SSLv2.0 protocol. */ 499 PJ_SSL_SOCK_PROTO_DTLS1 /**< DTLSv1.0 protocol. */ 494 /** 495 * Default protocol of backend. 496 */ 497 PJ_SSL_SOCK_PROTO_DEFAULT = 0, 498 499 /** 500 * SSLv2.0 protocol. 501 */ 502 PJ_SSL_SOCK_PROTO_SSL2 = (1 << 0), 503 504 /** 505 * SSLv3.0 protocol. 506 */ 507 PJ_SSL_SOCK_PROTO_SSL3 = (1 << 1), 508 509 /** 510 * TLSv1.0 protocol. 511 */ 512 PJ_SSL_SOCK_PROTO_TLS1 = (1 << 2), 513 514 /** 515 * TLSv1.1 protocol. 516 */ 517 PJ_SSL_SOCK_PROTO_TLS1_1 = (1 << 3), 518 519 /** 520 * TLSv1.2 protocol. 521 */ 522 PJ_SSL_SOCK_PROTO_TLS1_2 = (1 << 4), 523 524 /** 525 * Certain backend implementation e.g:OpenSSL, has feature to enable all 526 * protocol. 527 */ 528 PJ_SSL_SOCK_PROTO_SSL23 = (1 << 16) - 1, 529 530 /** 531 * DTLSv1.0 protocol. 532 */ 533 PJ_SSL_SOCK_PROTO_DTLS1 = (1 << 16), 534 500 535 } pj_ssl_sock_proto; 501 536 … … 513 548 514 549 /** 515 * Describes secure socket protocol being used. 516 */ 517 pj_ssl_sock_proto proto; 550 * Describes secure socket protocol being used, see #pj_ssl_sock_proto. 551 * Use bitwise OR operation to combine the protocol type. 552 */ 553 pj_uint32_t proto; 518 554 519 555 /** … … 615 651 616 652 /** 617 * Specify security protocol to use, see #pj_ssl_sock_proto. 653 * Specify security protocol to use, see #pj_ssl_sock_proto. Use bitwise OR 654 * operation to combine the protocol type. 618 655 * 619 656 * Default is PJ_SSL_SOCK_PROTO_DEFAULT. 620 657 */ 621 pj_ ssl_sock_protoproto;658 pj_uint32_t proto; 622 659 623 660 /** -
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r4901 r4968 503 503 EC_KEY *ecdh; 504 504 #endif 505 SSL_METHOD *ssl_method ;505 SSL_METHOD *ssl_method = NULL; 506 506 SSL_CTX *ctx; 507 pj_uint32_t ssl_opt = 0; 507 508 pj_ssl_cert_t *cert; 508 509 int mode, rc; … … 515 516 /* Make sure OpenSSL library has been initialized */ 516 517 init_openssl(); 518 519 if (ssock->param.proto == PJ_SSL_SOCK_PROTO_DEFAULT) 520 ssock->param.proto = PJ_SSL_SOCK_PROTO_SSL23; 517 521 518 522 /* Determine SSL method to use */ … … 529 533 ssl_method = (SSL_METHOD*)SSLv3_method(); 530 534 break; 531 case PJ_SSL_SOCK_PROTO_DEFAULT: 532 case PJ_SSL_SOCK_PROTO_SSL23: 535 } 536 537 if (!ssl_method) { 533 538 ssl_method = (SSL_METHOD*)SSLv23_method(); 534 break; 535 //case PJ_SSL_SOCK_PROTO_DTLS1: 536 //ssl_method = (SSL_METHOD*)DTLSv1_method(); 537 //break; 538 default: 539 return PJ_EINVAL; 539 540 #ifdef SSL_OP_NO_SSLv2 541 /** Check if SSLv2 is enabled */ 542 ssl_opt |= ((ssock->param.proto & PJ_SSL_SOCK_PROTO_SSL2)==0)? 543 SSL_OP_NO_SSLv2:0; 544 #endif 545 546 #ifdef SSL_OP_NO_SSLv3 547 /** Check if SSLv3 is enabled */ 548 ssl_opt |= ((ssock->param.proto & PJ_SSL_SOCK_PROTO_SSL3)==0)? 549 SSL_OP_NO_SSLv3:0; 550 #endif 551 552 #ifdef SSL_OP_NO_TLSv1 553 /** Check if TLSv1 is enabled */ 554 ssl_opt |= ((ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1)==0)? 555 SSL_OP_NO_TLSv1:0; 556 #endif 557 558 #ifdef SSL_OP_NO_TLSv1_1 559 /** Check if TLSv1_1 is enabled */ 560 ssl_opt |= ((ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_1)==0)? 561 SSL_OP_NO_TLSv1_1:0; 562 #endif 563 564 #ifdef SSL_OP_NO_TLSv1_2 565 /** Check if TLSv1_2 is enabled */ 566 ssl_opt |= ((ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_2)==0)? 567 SSL_OP_NO_TLSv1_2:0; 568 569 #endif 570 540 571 } 541 572 … … 545 576 return GET_SSL_STATUS(ssock); 546 577 } 578 if (ssl_opt) 579 SSL_CTX_set_options(ctx, ssl_opt); 547 580 548 581 /* Apply credentials */ -
pjproject/trunk/pjlib/src/pj/ssl_sock_symbian.cpp
r4829 r4968 1384 1384 1385 1385 /* CSecureSocket only support TLS1.0 and SSL3.0 */ 1386 switch(ssock->proto) { 1387 case PJ_SSL_SOCK_PROTO_TLS1: 1386 if (ssock->proto & PJ_SSL_SOCK_PROTO_TLS1==PJ_SSL_SOCK_PROTO_TLS1) { 1388 1387 proto.Set((const TUint8*)"TLS1.0", 6); 1389 break; 1390 case PJ_SSL_SOCK_PROTO_SSL3: 1388 } else if (ssock->proto & PJ_SSL_SOCK_PROTO_SSL3==PJ_SSL_SOCK_PROTO_SSL3) { 1391 1389 proto.Set((const TUint8*)"SSL3.0", 6); 1392 break; 1393 default: 1390 } else { 1394 1391 return PJ_ENOTSUP; 1395 1392 } -
pjproject/trunk/pjsip-apps/src/swig/symbols.i
r4845 r4968 32 32 33 33 typedef enum pj_ssl_cipher {PJ_TLS_UNKNOWN_CIPHER = -1, PJ_TLS_NULL_WITH_NULL_NULL = 0x00000000, PJ_TLS_RSA_WITH_NULL_MD5 = 0x00000001, PJ_TLS_RSA_WITH_NULL_SHA = 0x00000002, PJ_TLS_RSA_WITH_NULL_SHA256 = 0x0000003B, PJ_TLS_RSA_WITH_RC4_128_MD5 = 0x00000004, PJ_TLS_RSA_WITH_RC4_128_SHA = 0x00000005, PJ_TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x0000000A, PJ_TLS_RSA_WITH_AES_128_CBC_SHA = 0x0000002F, PJ_TLS_RSA_WITH_AES_256_CBC_SHA = 0x00000035, PJ_TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003C, PJ_TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x0000003D, PJ_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x0000000D, PJ_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000010, PJ_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x00000013, PJ_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000016, PJ_TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x00000030, PJ_TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x00000031, PJ_TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x00000032, PJ_TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x00000033, PJ_TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x00000036, PJ_TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x00000037, PJ_TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x00000038, PJ_TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x00000039, PJ_TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x0000003E, PJ_TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003F, PJ_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x00000040, PJ_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x00000067, PJ_TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x00000068, PJ_TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x00000069, PJ_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x0000006A, PJ_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x0000006B, PJ_TLS_DH_anon_WITH_RC4_128_MD5 = 0x00000018, PJ_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x0000001B, PJ_TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x00000034, PJ_TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x0000003A, PJ_TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x0000006C, PJ_TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x0000006D, PJ_TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x00000003, PJ_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x00000006, PJ_TLS_RSA_WITH_IDEA_CBC_SHA = 0x00000007, PJ_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000008, PJ_TLS_RSA_WITH_DES_CBC_SHA = 0x00000009, PJ_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0000000B, PJ_TLS_DH_DSS_WITH_DES_CBC_SHA = 0x0000000C, PJ_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0000000E, PJ_TLS_DH_RSA_WITH_DES_CBC_SHA = 0x0000000F, PJ_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x00000011, PJ_TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x00000012, PJ_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000014, PJ_TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x00000015, PJ_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x00000017, PJ_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x00000019, PJ_TLS_DH_anon_WITH_DES_CBC_SHA = 0x0000001A, PJ_SSL_FORTEZZA_KEA_WITH_NULL_SHA = 0x0000001C, PJ_SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA = 0x0000001D, PJ_SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 0x0000001E, PJ_SSL_CK_RC4_128_WITH_MD5 = 0x00010080, PJ_SSL_CK_RC4_128_EXPORT40_WITH_MD5 = 0x00020080, PJ_SSL_CK_RC2_128_CBC_WITH_MD5 = 0x00030080, PJ_SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 = 0x00040080, PJ_SSL_CK_IDEA_128_CBC_WITH_MD5 = 0x00050080, PJ_SSL_CK_DES_64_CBC_WITH_MD5 = 0x00060040, PJ_SSL_CK_DES_192_EDE3_CBC_WITH_MD5 = 0x000700C0} pj_ssl_cipher; 34 35 typedef enum pj_ssl_sock_proto {PJ_SSL_SOCK_PROTO_DEFAULT = 0, PJ_SSL_SOCK_PROTO_SSL2 = 1 << 0, PJ_SSL_SOCK_PROTO_SSL3 = 1 << 1, PJ_SSL_SOCK_PROTO_TLS1 = 1 << 2, PJ_SSL_SOCK_PROTO_TLS1_1 = 1 << 3, PJ_SSL_SOCK_PROTO_TLS1_2 = 1 << 4, PJ_SSL_SOCK_PROTO_SSL23 = (1 << 16) - 1, PJ_SSL_SOCK_PROTO_DTLS1 = 1 << 16} pj_ssl_sock_proto; 34 36 35 37 typedef enum pj_stun_nat_type {PJ_STUN_NAT_TYPE_UNKNOWN, PJ_STUN_NAT_TYPE_ERR_UNKNOWN, PJ_STUN_NAT_TYPE_OPEN, PJ_STUN_NAT_TYPE_BLOCKED, PJ_STUN_NAT_TYPE_SYMMETRIC_UDP, PJ_STUN_NAT_TYPE_FULL_CONE, PJ_STUN_NAT_TYPE_SYMMETRIC, PJ_STUN_NAT_TYPE_RESTRICTED, PJ_STUN_NAT_TYPE_PORT_RESTRICTED} pj_stun_nat_type; … … 108 110 typedef enum pjsip_transport_state {PJSIP_TP_STATE_CONNECTED, PJSIP_TP_STATE_DISCONNECTED, PJSIP_TP_STATE_SHUTDOWN, PJSIP_TP_STATE_DESTROY} pjsip_transport_state; 109 111 110 typedef enum pjsip_ssl_method {PJSIP_SSL_UNSPECIFIED_METHOD = 0, PJSIP_ TLSV1_METHOD = 31, PJSIP_SSLV2_METHOD = 20, PJSIP_SSLV3_METHOD = 30, PJSIP_SSLV23_METHOD = 23} pjsip_ssl_method;112 typedef enum pjsip_ssl_method {PJSIP_SSL_UNSPECIFIED_METHOD = 0, PJSIP_SSLV2_METHOD = 20, PJSIP_SSLV3_METHOD = 30, PJSIP_TLSV1_METHOD = 31, PJSIP_TLSV1_1_METHOD = 32, PJSIP_TLSV1_2_METHOD = 33, PJSIP_SSLV23_METHOD = 23} pjsip_ssl_method; 111 113 112 114 typedef enum pjsip_tsx_state_e {PJSIP_TSX_STATE_NULL, PJSIP_TSX_STATE_CALLING, PJSIP_TSX_STATE_TRYING, PJSIP_TSX_STATE_PROCEEDING, PJSIP_TSX_STATE_COMPLETED, PJSIP_TSX_STATE_CONFIRMED, PJSIP_TSX_STATE_TERMINATED, PJSIP_TSX_STATE_DESTROYED, PJSIP_TSX_STATE_MAX} pjsip_tsx_state_e; -
pjproject/trunk/pjsip-apps/src/swig/symbols.lst
r4845 r4968 3 3 pj/log.h pj_log_decoration 4 4 pj/sock_qos.h pj_qos_type pj_qos_flag pj_qos_wmm_prio pj_qos_params 5 pj/ssl_sock.h pj_ssl_cipher 5 pj/ssl_sock.h pj_ssl_cipher pj_ssl_sock_proto 6 6 7 7 pjnath/nat_detect.h pj_stun_nat_type -
pjproject/trunk/pjsip/include/pjsip/sip_transport_tls.h
r4860 r4968 52 52 #endif 53 53 54 54 55 /** SSL protocol method constants. */ 55 56 typedef enum pjsip_ssl_method 56 57 { 57 PJSIP_SSL_UNSPECIFIED_METHOD= 0, /**< Default protocol method. */ 58 PJSIP_TLSV1_METHOD = 31, /**< Use SSLv1 method. */ 59 PJSIP_SSLV2_METHOD = 20, /**< Use SSLv2 method. */ 60 PJSIP_SSLV3_METHOD = 30, /**< Use SSLv3 method. */ 61 PJSIP_SSLV23_METHOD = 23 /**< Use SSLv23 method. */ 58 PJSIP_SSL_UNSPECIFIED_METHOD = 0, /**< Default protocol method. */ 59 PJSIP_SSLV2_METHOD = 20, /**< Use SSLv2 method. */ 60 PJSIP_SSLV3_METHOD = 30, /**< Use SSLv3 method. */ 61 PJSIP_TLSV1_METHOD = 31, /**< Use TLSv1 method. */ 62 PJSIP_TLSV1_1_METHOD = 32, /**< Use TLSv1_1 method. */ 63 PJSIP_TLSV1_2_METHOD = 33, /**< Use TLSv1_2 method. */ 64 PJSIP_SSLV23_METHOD = 23, /**< Use SSLv23 method. */ 62 65 } pjsip_ssl_method; 63 66 64 65 67 /** 68 * The default enabled SSL proto to be used. 69 * Default is all protocol above TLSv1 (TLSv1 & TLS v1.1 & TLS v1.2). 70 */ 71 #ifndef PJSIP_SSL_DEFAULT_PROTO 72 # define PJSIP_SSL_DEFAULT_PROTO (PJ_SSL_SOCK_PROTO_TLS1 | \ 73 PJ_SSL_SOCK_PROTO_TLS1_1 | \ 74 PJ_SSL_SOCK_PROTO_TLS1_2) 75 #endif 66 76 67 77 /** … … 93 103 94 104 /** 95 * TLS protocol method from #pjsip_ssl_method, which can be: 96 * - PJSIP_SSL_UNSPECIFIED_METHOD(0): default (which will use 97 * PJSIP_SSL_DEFAULT_METHOD) 98 * - PJSIP_TLSV1_METHOD(1): TLSv1 99 * - PJSIP_SSLV2_METHOD(2): SSLv2 100 * - PJSIP_SSLV3_METHOD(3): SSL3 101 * - PJSIP_SSLV23_METHOD(23): SSL23 105 * TLS protocol method from #pjsip_ssl_method. In the future, this field 106 * might be deprecated in favor of <b>proto</b> field. For now, this field 107 * is only applicable only when <b>proto</b> field is set to zero. 102 108 * 103 109 * Default is PJSIP_SSL_UNSPECIFIED_METHOD (0), which in turn will 104 * use PJSIP_SSL_DEFAULT_METHOD, which default value is 105 * PJSIP_TLSV1_METHOD. 106 */ 107 int method; 110 * use PJSIP_SSL_DEFAULT_METHOD, which default value is PJSIP_TLSV1_METHOD. 111 */ 112 pjsip_ssl_method method; 113 114 /** 115 * TLS protocol type from #pj_ssl_sock_proto. Use this field to enable 116 * specific protocol type. Use bitwise OR operation to combine the protocol 117 * type. 118 * 119 * Default is PJSIP_SSL_DEFAULT_PROTO. 120 */ 121 pj_uint32_t proto; 108 122 109 123 /** … … 253 267 tls_opt->qos_ignore_error = PJ_TRUE; 254 268 tls_opt->sockopt_ignore_error = PJ_TRUE; 269 tls_opt->proto = PJSIP_SSL_DEFAULT_PROTO; 255 270 } 256 271 -
pjproject/trunk/pjsip/include/pjsua2/siptypes.hpp
r4918 r4968 146 146 147 147 /** 148 * TLS protocol method from pjsip_ssl_method. 148 * TLS protocol method from #pjsip_ssl_method. In the future, this field 149 * might be deprecated in favor of <b>proto</b> field. For now, this field 150 * is only applicable only when <b>proto</b> field is set to zero. 149 151 * 150 152 * Default is PJSIP_SSL_UNSPECIFIED_METHOD (0), which in turn will 151 * use PJSIP_SSL_DEFAULT_METHOD, which default value is 152 * PJSIP_TLSV1_METHOD. 153 * use PJSIP_SSL_DEFAULT_METHOD, which default value is PJSIP_TLSV1_METHOD. 153 154 */ 154 155 pjsip_ssl_method method; 156 157 /** 158 * TLS protocol type from #pj_ssl_sock_proto. Use this field to enable 159 * specific protocol type. Use bitwise OR operation to combine the protocol 160 * type. 161 * 162 * Default is PJSIP_SSL_DEFAULT_PROTO. 163 */ 164 unsigned proto; 155 165 156 166 /** -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
r4882 r4968 186 186 187 187 188 static pj_uint32_t ssl_get_proto(pjsip_ssl_method ssl_method, pj_uint32_t proto) 189 { 190 pj_uint32_t out_proto; 191 192 if (proto) 193 return proto; 194 195 if (ssl_method == PJSIP_SSL_UNSPECIFIED_METHOD) 196 ssl_method = PJSIP_SSL_DEFAULT_METHOD; 197 198 switch(ssl_method) { 199 case PJSIP_SSLV2_METHOD: 200 out_proto = PJ_SSL_SOCK_PROTO_SSL2; 201 break; 202 case PJSIP_SSLV3_METHOD: 203 out_proto = PJ_SSL_SOCK_PROTO_SSL3; 204 break; 205 case PJSIP_TLSV1_METHOD: 206 out_proto = PJ_SSL_SOCK_PROTO_TLS1; 207 break; 208 case PJSIP_TLSV1_1_METHOD: 209 out_proto = PJ_SSL_SOCK_PROTO_TLS1_1; 210 break; 211 case PJSIP_TLSV1_2_METHOD: 212 out_proto = PJ_SSL_SOCK_PROTO_TLS1_2; 213 break; 214 case PJSIP_SSLV23_METHOD: 215 out_proto = PJ_SSL_SOCK_PROTO_SSL23; 216 break; 217 default: 218 out_proto = PJ_SSL_SOCK_PROTO_DEFAULT; 219 break; 220 } 221 return out_proto; 222 } 223 224 188 225 static void tls_init_shutdown(struct tls_transport *tls, pj_status_t status) 189 226 { … … 276 313 pj_bool_t is_ipv6; 277 314 int af, sip_ssl_method; 315 pj_uint32_t sip_ssl_proto; 278 316 struct tls_listener *listener; 279 317 pj_ssl_sock_param ssock_param; … … 369 407 370 408 sip_ssl_method = listener->tls_setting.method; 371 if (sip_ssl_method==PJSIP_SSL_UNSPECIFIED_METHOD) 372 sip_ssl_method = PJSIP_SSL_DEFAULT_METHOD; 373 374 switch(sip_ssl_method) { 375 case PJSIP_TLSV1_METHOD: 376 ssock_param.proto = PJ_SSL_SOCK_PROTO_TLS1; 377 break; 378 case PJSIP_SSLV2_METHOD: 379 ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL2; 380 break; 381 case PJSIP_SSLV3_METHOD: 382 ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL3; 383 break; 384 case PJSIP_SSLV23_METHOD: 385 ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL23; 386 break; 387 default: 388 ssock_param.proto = PJ_SSL_SOCK_PROTO_DEFAULT; 389 break; 390 } 409 sip_ssl_proto = listener->tls_setting.proto; 410 ssock_param.proto = ssl_get_proto(sip_ssl_method, sip_ssl_proto); 391 411 392 412 /* Create group lock */ … … 964 984 struct tls_transport *tls; 965 985 int sip_ssl_method; 986 pj_uint32_t sip_ssl_proto; 966 987 pj_pool_t *pool; 967 988 pj_grp_lock_t *glock; … … 1028 1049 1029 1050 sip_ssl_method = listener->tls_setting.method; 1030 if (sip_ssl_method==PJSIP_SSL_UNSPECIFIED_METHOD) 1031 sip_ssl_method = PJSIP_SSL_DEFAULT_METHOD; 1032 1033 switch(sip_ssl_method) { 1034 case PJSIP_TLSV1_METHOD: 1035 ssock_param.proto = PJ_SSL_SOCK_PROTO_TLS1; 1036 break; 1037 case PJSIP_SSLV2_METHOD: 1038 ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL2; 1039 break; 1040 case PJSIP_SSLV3_METHOD: 1041 ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL3; 1042 break; 1043 case PJSIP_SSLV23_METHOD: 1044 ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL23; 1045 break; 1046 default: 1047 ssock_param.proto = PJ_SSL_SOCK_PROTO_DEFAULT; 1048 break; 1049 } 1051 sip_ssl_proto = listener->tls_setting.proto; 1052 ssock_param.proto = ssl_get_proto(sip_ssl_method, sip_ssl_proto); 1050 1053 1051 1054 /* Create group lock */ -
pjproject/trunk/pjsip/src/pjsua2/siptypes.cpp
r4884 r4968 166 166 ts.method = this->method; 167 167 ts.ciphers_num = (unsigned)this->ciphers.size(); 168 ts.proto = this->proto; 168 169 // The following will only work if sizeof(enum)==sizeof(int) 169 170 pj_assert(sizeof(ts.ciphers[0]) == sizeof(int)); … … 189 190 this->password = pj2Str(prm.password); 190 191 this->method = (pjsip_ssl_method)prm.method; 192 this->proto = prm.proto; 191 193 // The following will only work if sizeof(enum)==sizeof(int) 192 194 pj_assert(sizeof(prm.ciphers[0]) == sizeof(int));
Note: See TracChangeset
for help on using the changeset viewer.