Commit 21f1d202 authored by mikeytown2's avatar mikeytown2

Issue #2780147 by zenimagine: SSL cert problems when using PHP 5.6+

parent 1a146322
......@@ -677,10 +677,12 @@ function httprl_set_socket($uri, &$options, $proxy_server, &$result) {
// Disable SNI support as this causes issues with old versions of OpenSSL.
// By default httprl doesn't validate the SSL certificate, so this is OK.
if (empty($options['context'])) {
$drupal_ssl_context_options = variable_get('drupal_ssl_context_options', array('verify_peer' => TRUE));
// Affected versions of openssl are 1.0.0i to 1.0.1b.
if (!defined('OPENSSL_VERSION_NUMBER') || (OPENSSL_VERSION_NUMBER >= 0x1000009f && OPENSSL_VERSION_NUMBER <= 0x1000102f)) {
$options['context'] = stream_context_create(array('ssl' => array('SNI_enabled' => FALSE)));
$drupal_ssl_context_options += array('SNI_enabled' => FALSE);
}
$options['context'] = stream_context_create(array('ssl' => $drupal_ssl_context_options));
}
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment