瀏覽代碼

Merge pull request #4599 from davidfuhr/http-400-error-handling

Fix handling of http 400 errors
Jordi Boggiano 9 年之前
父節點
當前提交
04879e82ae
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/Composer/Util/RemoteFilesystem.php

+ 6 - 0
src/Composer/Util/RemoteFilesystem.php

@@ -334,6 +334,12 @@ class RemoteFilesystem
     {
         switch ($notificationCode) {
             case STREAM_NOTIFY_FAILURE:
+                if (400 === $messageCode) {
+                    // This might happen if your host is secured by ssl client certificate authentication
+                    // but you do not send an appropriate certificate
+                    throw new TransportException("The '" . $this->fileUrl . "' URL could not be accessed: " . $message, $messageCode);
+                }
+
             case STREAM_NOTIFY_AUTH_REQUIRED:
                 if (401 === $messageCode) {
                     // Bail if the caller is going to handle authentication failures itself.