From 3444bdae821fa363d4059432bdf5bfded8ceff05 Mon Sep 17 00:00:00 2001 From: Jordan Alliot Date: Thu, 5 Jan 2012 11:58:49 +0100 Subject: [PATCH] Check openssl extension for proxy --- src/Composer/Downloader/FileDownloader.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index a96e64f1e..aeb655be4 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -64,6 +64,10 @@ abstract class FileDownloader implements DownloaderInterface // http(s):// is not supported in proxy $proxy = str_replace(array('http://', 'https://'), array('tcp://', 'ssl://'), $_SERVER['HTTP_PROXY']); + if (0 === strpos($proxy, 'ssl:') && !extension_loaded('openssl')) { + throw new \RuntimeException('You must enable the openssl extension to use a proxy over https'); + } + $ctx = stream_context_create(array( 'http' => array( 'proxy' => $proxy,