private function setAllowSslDowngrade($choice)
    {
        $repos = $this->getComposer()->getRepositoryManager()->getRepositories();

        /** @var ConfigurableRepositoryInterface $repo */
        foreach ($repos as $repo) {
            if (!$repo instanceof ComposerRepository) {
                continue;
            }
            $reflection = new \ReflectionClass($repo);
            $allowSslDowngrade = $reflection->getProperty('allowSslDowngrade');
            $allowSslDowngrade->setAccessible(true);
            $allowSslDowngrade->setValue($repo, $choice);
        }

        $config = $this->getComposer()->getConfig();
        $reflection = new \ReflectionClass($config);
        $property = $reflection->getProperty('config');
        $property->setAccessible(true);
        $values = $property->getValue($config);
        $values['secure-http'] = !$choice;
        $property->setValue($config, $values);
    }