How to correct the [Composer\Downloader\TransportException] error for composer

The issue could be caused by the redirect from http to https. (or your firewall blocking the call)

According to this article the problem could be solved by adding the following to your composer.json:

"repositories": [
    {
         "type": "composer", 
         "url": "https://packagist.org"
    },
    { "packagist": false }
]

Forcing composer to use https connections to Packagist


I just updated my composer to the latest version and this problem is solved.

Try

composer self-update

To know the current version and update details:

composer diagnose


You could also run this command on the CLI before installing any dependencies. It forces composer to use https to download all resources:

composer config -g repo.packagist composer https://packagist.org