Commit 4b9f9617 authored by drothstein's avatar drothstein Committed by mikeytown2

Issue #1977160 by David_Rothstein, mikeytown2: Allow code to specify different versions of SSL.

parent bb3d2fc0
......@@ -357,6 +357,7 @@ function httprl_set_default_options(&$options) {
'connect_timeout' => httprl_variable_get('httprl_connect_timeout', HTTPRL_CONNECT_TIMEOUT),
'ttfb_timeout' => httprl_variable_get('httprl_ttfb_timeout', HTTPRL_TTFB_TIMEOUT),
'context' => NULL,
'secure_socket_transport' => 'ssl',
'blocking' => TRUE,
'version' => '1.0',
'referrer' => FALSE,
......@@ -485,7 +486,7 @@ function httprl_set_socket($uri, &$options, $proxy_server, &$result) {
case 'https':
// Note: Only works when PHP is compiled with OpenSSL support.
$port = isset($uri['port']) ? $uri['port'] : 443;
$socket = 'ssl://' . $uri['host'] . ':' . $port;
$socket = $options['secure_socket_transport'] . '://' . $uri['host'] . ':' . $port;
if (empty($options['headers']['Host'])) {
$options['headers']['Host'] = $uri['host'];
}
......@@ -894,6 +895,11 @@ function httprl_establish_stream_connection(&$result) {
* seconds. If a timeout occurs, the error code is set to the
* HTTPRL_REQUEST_ABORTED constant.
* - context: A context resource created with stream_context_create().
* - secure_socket_transport: The transport to use when making secure
* requests over HTTPS; see http://php.net/manual/en/transports.inet.php
* for more information. The value should be 'ssl', 'sslv2', 'sslv3' or
* 'tls'. Defaults to 'ssl', which will work for HTTPS requests to most
* remote servers.
* - blocking: set to FALSE to make this not care about the returned data.
* - version: HTTP Version 1.0 or 1.1. Default is 1.0 for a good reason.
* - referrer: TRUE - send current page; FALSE - do not send current
......
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