From ebb1c27f05074e4b4a82d7e50c93dca7ce096c70 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Thu, 27 Feb 2014 06:16:36 +0000 Subject: Fixed #1740: TLS will be used whenever request URI uses "sips" scheme regardless the target-URI scheme/transport. This behavior is configurable via 'PJSIP_DONT_SWITCH_TO_TLS' in compile-time, or 'pjsip_cfg()->disable_tls_switch' in run-time. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4770 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/include/pjsip/sip_config.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'pjsip/include/pjsip/sip_config.h') diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h index 95f75383..fc7604cb 100644 --- a/pjsip/include/pjsip/sip_config.h +++ b/pjsip/include/pjsip/sip_config.h @@ -111,6 +111,15 @@ typedef struct pjsip_cfg_t */ pj_bool_t disable_tcp_switch; + /** + * Disable automatic switching to TLS if target-URI does not use + * "sips" scheme nor TLS transport, even when request-URI uses + * "sips" scheme. + * + * Default is PJSIP_DONT_SWITCH_TO_TLS. + */ + pj_bool_t disable_tls_switch; + /** * Enable call media session to always be updated to the latest * received early media SDP when receiving forked early media @@ -308,6 +317,24 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) #endif +/** + * As specified RFC 3261 section 8.1.2, when request-URI uses "sips" scheme, + * TLS must always be used regardless of the target-URI scheme or transport + * type. + * + * This option will specify whether the behavior of automatic switching to TLS + * should be disabled, i.e: regard the target-URI scheme or transport type. + * + * This option can also be controlled at run-time by the \a disable_tls_switch + * setting in pjsip_cfg_t. + * + * Default is 0 (no). + */ +#ifndef PJSIP_DONT_SWITCH_TO_TLS +# define PJSIP_DONT_SWITCH_TO_TLS 0 +#endif + + /** * Specify whether the call media session should be updated to the latest * received early media SDP when receiving forked early media (multiple 183 -- cgit v1.2.3