$originUrl passed to RemoteFilesystem is actually a HOST string already (so far!)
parent
0a8180674e
commit
49590af656
|
@ -50,7 +50,6 @@ EOT
|
|||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
|
||||
$this->rfs = new RemoteFilesystem($this->getIO());
|
||||
$this->process = new ProcessExecutor($this->getIO());
|
||||
|
||||
$output->write('Checking platform settings: ');
|
||||
|
@ -157,7 +156,7 @@ EOT
|
|||
$remoteFilesystemOptions = array('ssl'=>array('cafile'=>$config->get('cafile')));
|
||||
}
|
||||
try {
|
||||
$remoteFilesystem = new RemoteFilesystem($this->getIO(), $remoteFilesystemOptions, $disableTls);
|
||||
$this->rfs = new RemoteFilesystem($this->getIO(), $remoteFilesystemOptions, $disableTls);
|
||||
} catch (TransportException $e) {
|
||||
if (preg_match('|cafile|', $e->getMessage())) {
|
||||
$result[] = '<error>[' . get_class($e) . '] ' . $e->getMessage() . '</error>';
|
||||
|
@ -169,7 +168,7 @@ EOT
|
|||
}
|
||||
|
||||
try {
|
||||
$json = $remoteFilesystem->getContents('packagist.org', $protocol . '://packagist.org/packages.json', false, array(), $disableTls);
|
||||
$json = $this->rfs->getContents('packagist.org', $protocol . '://packagist.org/packages.json', false, array(), $disableTls);
|
||||
} catch (\Exception $e) {
|
||||
array_unshift($result, '[' . get_class($e) . '] ' . $e->getMessage());
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ class ConfigValidator
|
|||
// validate json schema
|
||||
$laxValid = false;
|
||||
try {
|
||||
$json = new JsonFile($file, new RemoteFilesystem($this->io));
|
||||
$json = new JsonFile($file, new RemoteFilesystem($this->io)); //TODO
|
||||
$manifest = $json->read();
|
||||
|
||||
$json->validateSchema(JsonFile::LAX_SCHEMA);
|
||||
|
|
|
@ -342,7 +342,11 @@ class RemoteFilesystem
|
|||
|
||||
// Setup remaining TLS options - the matching may need monitoring, esp. www vs none in CN
|
||||
if ($disableTls === false) {
|
||||
if (!preg_match("|^https?://|", $originUrl)) {
|
||||
$host = $originUrl;
|
||||
} else {
|
||||
$host = parse_url($originUrl, PHP_URL_HOST);
|
||||
}
|
||||
$this->options['ssl']['CN_match'] = $host;
|
||||
$this->options['ssl']['SNI_server_name'] = $host;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue