diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | app/Core/Http/Client.php | 11 | ||||
-rw-r--r-- | app/constants.php | 3 | ||||
-rw-r--r-- | config.default.php | 3 | ||||
-rw-r--r-- | doc/config.markdown | 11 |
5 files changed, 25 insertions, 4 deletions
@@ -8,6 +8,7 @@ New features: * Added menu entry to add tasks from all project views * Add tasks in bulk from the board * Add dropdown for projects +* Added config parameter to allow self-signed certificates for the HTTP client Improvements: diff --git a/app/Core/Http/Client.php b/app/Core/Http/Client.php index 16e423dc..3c4397e2 100644 --- a/app/Core/Http/Client.php +++ b/app/Core/Http/Client.php @@ -163,6 +163,7 @@ class Client extends Base if (DEBUG) { $this->logger->debug('HttpClient: url='.$url); + $this->logger->debug('HttpClient: headers='.var_export($headers, true)); $this->logger->debug('HttpClient: payload='.$content); $this->logger->debug('HttpClient: metadata='.var_export(@stream_get_meta_data($stream), true)); $this->logger->debug('HttpClient: response='.$response); @@ -201,7 +202,7 @@ class Client extends Base 'timeout' => self::HTTP_TIMEOUT, 'max_redirects' => self::HTTP_MAX_REDIRECTS, 'header' => implode("\r\n", $headers), - 'content' => $content + 'content' => $content, ) ); @@ -210,6 +211,14 @@ class Client extends Base $context['http']['request_fulluri'] = true; } + if (HTTP_VERIFY_SSL_CERTIFICATE === false) { + $context['ssl'] = array( + 'verify_peer' => false, + 'verify_peer_name' => false, + 'allow_self_signed' => true, + ); + } + return $context; } } diff --git a/app/constants.php b/app/constants.php index 3c404d8b..604f6acd 100644 --- a/app/constants.php +++ b/app/constants.php @@ -128,8 +128,9 @@ defined('BRUTEFORCE_LOCKDOWN_DURATION') or define('BRUTEFORCE_LOCKDOWN_DURATION' // See http://php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime defined('SESSION_DURATION') or define('SESSION_DURATION', 0); -// HTTP client proxy +// HTTP Client defined('HTTP_PROXY_HOSTNAME') or define('HTTP_PROXY_HOSTNAME', ''); defined('HTTP_PROXY_PORT') or define('HTTP_PROXY_PORT', '3128'); defined('HTTP_PROXY_USERNAME') or define('HTTP_PROXY_USERNAME', ''); defined('HTTP_PROXY_PASSWORD') or define('HTTP_PROXY_PASSWORD', ''); +defined('HTTP_VERIFY_SSL_CERTIFICATE') or define('HTTP_VERIFY_SSL_CERTIFICATE', true); diff --git a/config.default.php b/config.default.php index e3f8932c..a9fd7d99 100644 --- a/config.default.php +++ b/config.default.php @@ -208,3 +208,6 @@ define('HTTP_PROXY_HOSTNAME', ''); define('HTTP_PROXY_PORT', '3128'); define('HTTP_PROXY_USERNAME', ''); define('HTTP_PROXY_PASSWORD', ''); + +// Set to false to allow self-signed certificates +define('HTTP_VERIFY_SSL_CERTIFICATE', true); diff --git a/doc/config.markdown b/doc/config.markdown index 0325358d..e51fd54a 100644 --- a/doc/config.markdown +++ b/doc/config.markdown @@ -267,8 +267,8 @@ Session define('SESSION_DURATION', 0); ``` -HTTP client proxy ------------------ +HTTP Client +----------- If external HTTP requests need to be sent through a proxy: @@ -279,6 +279,13 @@ define('HTTP_PROXY_USERNAME', ''); define('HTTP_PROXY_PASSWORD', ''); ``` +To allow self-signed certificates: + +```php +// Set to false to allow self-signed certificates +define('HTTP_VERIFY_SSL_CERTIFICATE', true); +``` + Various settings ---------------- |