[Freeswitch-svn] [commit] r5810 - in freeswitch/trunk: conf src/mod/xml_int/mod_xml_cdr

Freeswitch SVN xachen at freeswitch.org
Thu Oct 4 23:26:43 EDT 2007


Author: xachen
Date: Thu Oct  4 23:26:42 2007
New Revision: 5810

Modified:
   freeswitch/trunk/conf/xml_cdr.conf.xml
   freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c

Log:
add option to mod_xml_cdr to ignore ca root checks on https urls

Modified: freeswitch/trunk/conf/xml_cdr.conf.xml
==============================================================================
--- freeswitch/trunk/conf/xml_cdr.conf.xml	(original)
+++ freeswitch/trunk/conf/xml_cdr.conf.xml	Thu Oct  4 23:26:42 2007
@@ -20,5 +20,9 @@
     <!-- either an absolute path, a relative path assuming ${prefix}/logs or a blank or omitted value will default to ${prefix}/logs/xml_cdr -->
     <!-- <param name="err-log-dir" value="/tmp"/> -->
 
+    <!-- optional: if enabled this will disable CA root certificate checks by libcurl -->
+    <!-- note: default value is disabled. only enable if you want this! -->
+    <!-- <param name="ignore-cacert-check" value="true" /> -->
+
   </settings>
 </configuration>

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	(original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	Thu Oct  4 23:26:42 2007
@@ -41,6 +41,7 @@
 	uint32_t delay;
 	uint32_t retries;
 	uint32_t shutdown;
+	int ignore_cacert_check;
 } globals;
 
 SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load);
@@ -133,6 +134,10 @@
 			curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-xml/1.0");
 			curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, httpCallBack);
 
+			if (globals.ignore_cacert_check) {
+				curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE);
+			}
+
 			/* these were used for testing, optionally they may be enabled if someone desires
 			curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, 120); // tcp timeout
 			curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1); // 302 recursion level
@@ -257,6 +262,8 @@
 						globals.err_log_dir = switch_mprintf("%s/%s", SWITCH_GLOBAL_dirs.log_dir, val);
 					}
 				}
+			} else if (!strcasecmp(var, "ignore-cacert-check") && switch_true(val)) {
+				globals.ignore_cacert_check = 1;
 			}
 
 			if (switch_strlen_zero(globals.err_log_dir)) {



More information about the Freeswitch-svn mailing list