diff --git a/includes/common.inc b/includes/common.inc index 0ebe857..917f361 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -764,6 +764,8 @@ function drupal_access_denied() { * - timeout: A float representing the maximum number of seconds the function * call may take. The default is 30 seconds. If a timeout occurs, the error * code is set to the HTTP_REQUEST_TIMEOUT constant. + * - ssl_version: The HTTPS certificate version used by the remote server. The + * value should either be 'sslv2', 'sslv3' or 'tls'. * - context: A context resource created with stream_context_create(). * * @return object @@ -871,7 +873,8 @@ function drupal_http_request($url, array $options = array()) { case 'https': // Note: Only works when PHP is compiled with OpenSSL support. $port = isset($uri['port']) ? $uri['port'] : 443; - $socket = 'ssl://' . $uri['host'] . ':' . $port; + $transport = isset($options['ssl_version']) ? $options['ssl_version'] . '://' : 'ssl://'; + $socket = $transport . $uri['host'] . ':' . $port; $options['headers']['Host'] = $uri['host'] . ($port != 443 ? ':' . $port : ''); break;