From 38888b0420d4f9756197eed283f2ef57c9cbcf21 Mon Sep 17 00:00:00 2001 From: heddn Date: Wed, 10 Sep 2014 11:36:35 -0600 Subject: [PATCH] Issue #1879970 by cableman0408, heddn, David_Rothstein: Fixed drupal_http_request fails when remote server is using openssl v1.0.0 (allow calling code to specify sslv2 sslv3 tls). --- includes/common.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/common.inc b/includes/common.inc index 63b691e..b8fb3f9 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -875,6 +875,11 @@ function drupal_http_request($url, array $options = array()) { $port = isset($uri['port']) ? $uri['port'] : 443; $socket = 'ssl://' . $uri['host'] . ':' . $port; $options['headers']['Host'] = $uri['host'] . ($port != 443 ? ':' . $port : ''); + + // Disable SNI support as this causes issues with old versions of OpenSSL. + if (empty($options['context'])) { + $options['context'] = stream_context_create(array('ssl' => array('SNI_enabled' => FALSE))); + } break; default: -- 2.1.0