title: How to fix "https://repo.packagist.org/packages.json does not contain valid Json"?
body: <p>I've an issue with composer running on a vagrantbox (Centos 7), which started to just suddenly happen.</p>
  
  <p>I've already tried manually running the command/solution mentioned on the link below but to no avail.</p>
  
  <p>(To clarify, <strong><em>i'm using vagrant not docker</em></strong>, but it was the closest question i found to my situation. Most of the information i found are related to composer.json not being valid, but here is packagist.org/packages.json which, is currently valid)</p>
  
  <p><a href="https://stackoverflow.com/questions/50103847/composer-not-working-in-docker-container-https-packagist-org-packages-json">Composer not working in docker container: &quot;https://packagist.org/packages.json&quot; does not contain valid JSON</a></p>
  
  <p><strong><em>Here are the details of the issue.</em></strong></p>
  
  <p>While running <code>composer update</code> on terminal i get:</p>
  
  <pre><code> composer update
  
  
    [Seld\JsonLint\ParsingException]
    "https://repo.packagist.org/packages.json" does not contain valid JSON
    Parse error on line 1:
  
    ^
    Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
  
  </code></pre>
  
  <p>And when running <code>composer install</code> also on terminal every package returns this:</p>
  
  <pre><code>Failed to download psr/cache from dist: "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8" 
  appears broken, and returned an empty 200 response
      Now trying to download from source
  </code></pre>
  
  <p>When running <code>composer config --global repo.packagist composer packagist.org</code>
  the results are now</p>
  
  <pre><code>composer update
  Loading composer repositories with package information
  
  
    [Composer\Downloader\TransportException]
    Your configuration does not allow connections to http://repo.packagist.org/packages.json. See https://getcomposer.o
    rg/doc/06-config.md#secure-http for details.
  </code></pre>
  
  <p>Any ideas why this started to happen, how can i fix it?</p>