From 8abff794cd9a2ec695f03d6ad82c7e7f7b5e26f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draic=20Brady?= Date: Wed, 26 Feb 2014 20:48:39 +0000 Subject: [PATCH] Fix CN matching to use correct host (should almost eliminate TLS retries where wildcard CNs are used) --- src/Composer/Util/RemoteFilesystem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index c06099265..0c0f853f9 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -343,10 +343,10 @@ class RemoteFilesystem // Setup remaining TLS options - the matching may need monitoring, esp. www vs none in CN if ($this->disableTls === false) { - if (!preg_match("|^https?://|", $originUrl)) { + if (!preg_match("|^https?://|", $this->fileUrl)) { $host = $originUrl; } else { - $host = parse_url($originUrl, PHP_URL_HOST); + $host = parse_url($this->fileUrl, PHP_URL_HOST); } /** * This is sheer painful, but hopefully it'll be a footnote once SAN support