[commit] r5811 - in freeswitch/trunk: conf src/mod/xml_int/mod_xml_cdr src/mod/xml_int/mod_xml_curl
Author: xachen Date: Thu Oct 4 23:41:53 2007 New Revision: 5811 Modified: freeswitch/trunk/conf/xml_curl.conf.xml freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Log: add option to mod_xml_curl as well to make libcurl ignore ca cert roots Modified: freeswitch/trunk/conf/xml_curl.conf.xml ============================================================================== --- freeswitch/trunk/conf/xml_curl.conf.xml (original) +++ freeswitch/trunk/conf/xml_curl.conf.xml Thu Oct 4 23:41:53 2007 @@ -10,6 +10,10 @@ <!--<param name="gateway-credentials" value="muser:mypass"/>--> <!-- set to true to disable Expect: 100-continue lighttpd requires this setting --> <!--<param name="disable-100-continue" value="true"/>--> + + <!-- 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" /> --> </binding> </bindings> </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:41:53 2007 @@ -25,6 +25,7 @@ * * Brian West <brian.west@mac.com> * Bret McDanel <trixter AT 0xdecafbad.com> + * Justin Cassidy <xachenant@hotmail.com> * * mod_xml_cdr.c -- XML CDR Module to files or curl * @@ -41,7 +42,7 @@ uint32_t delay; uint32_t retries; uint32_t shutdown; - int ignore_cacert_check; + uint32_t ignore_cacert_check; } globals; SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load); Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c ============================================================================== --- freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (original) +++ freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Thu Oct 4 23:41:53 2007 @@ -24,6 +24,7 @@ * Contributor(s): * * Anthony Minessale II <anthmct@yahoo.com> + * Justin Cassidy <xachenant@hotmail.com> * * mod_xml_curl.c -- CURL XML Gateway * @@ -40,6 +41,7 @@ char *bindings; char *cred; int disable100continue; + uint32_t ignore_cacert_check; }; typedef struct xml_binding xml_binding_t; @@ -126,6 +128,10 @@ curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, slist); } + if (binding->ignore_cacert_check) { + curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE); + } + curl_easy_perform(curl_handle); curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE,&httpRes); curl_easy_cleanup(curl_handle); @@ -173,6 +179,7 @@ char *bind_cred = NULL; char *bind_mask = NULL; int disable100continue = 0; + uint32_t ignore_cacert_check = 0; for (param = switch_xml_child(binding_tag, "param"); param; param = param->next) { char *var = (char *) switch_xml_attr_soft(param, "name"); @@ -186,6 +193,8 @@ bind_cred = val; } else if (!strcasecmp(var, "disable-100-continue") && switch_true(val)) { disable100continue = 1; + } else if (!strcasecmp(var, "ignore-cacert-check") && switch_true(val)) { + ignore_cacert_check = 1; } } @@ -210,6 +219,7 @@ } binding->disable100continue = disable100continue; + binding->ignore_cacert_check = ignore_cacert_check; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML Fetch Function [%s] [%s]\n", switch_strlen_zero(bname) ? "N/A" : bname, binding->url, binding->bindings ? binding->bindings : "all");
participants (1)
-
Freeswitch SVN