function supportsSSL() { $v = curl_version(); if (is_array($v)) { return in_array('https', $v['protocols']); } elseif (is_string($v)) { return preg_match('/OpenSSL/i', $v); } else { return 0; } }