Index: openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl,v diff -u -r1.3.2.3 -r1.3.2.4 --- openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl 12 Sep 2016 11:10:52 -0000 1.3.2.3 +++ openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl 10 Oct 2016 13:38:50 -0000 1.3.2.4 @@ -229,6 +229,20 @@ return "" } +ad_proc -private util::http::native_https_api { +} { + Obtains the right https native API +} { + # Since naviserver 4.99.12 ns_http handles also https + if {[apm_version_names_compare \ + [ns_info patchlevel] "4.99.12"] >= 0} { + return [info commands ns_http] + } + # Default: check if we have ns_ssl + return [info commands ns_ssl] +} + + ad_proc -private util::http::apis_not_cached { } { Obtains implemented apis for http communication @@ -239,20 +253,23 @@ lappend http "curl" lappend https "curl" } + if {[info commands ns_http] ne ""} { lappend http "native" } - if {[info commands ns_ssl] ne ""} { + + if {[util::http::native_https_api] ne ""} { lappend https "native" } + return [list $http $https] } ad_proc -private util::http::apis { } { Obtains implemented apis for http communication } { - return [util_memoize [list util::http::apis_not_cached]] + return [ns_memoize -- util::http::apis_not_cached] } @@ -1065,10 +1082,10 @@ # Check wether we will use ssl or not if {$force_ssl_p || [string match "https://*" $url]} { - if {[info commands ns_ssl] eq ""} { + set http_api [util::http::native_https_api] + if {$http_api eq ""} { return -code error "${this_proc}: SSL not enabled" } - set http_api "ns_ssl" } else { set http_api "ns_http" }