Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Fix bug caused by some SSL implementations with bucket names that have dots in them. #42

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion services/s3.class.php
Expand Up @@ -555,9 +555,15 @@ public function authenticate($operation, $payload)
$this->temporary_prefix = true;
}

$bucket_name_may_cause_ssl_wildcard_failures = false;
if (strpos($bucket, '.') !== false)
{
$bucket_name_may_cause_ssl_wildcard_failures = true;
}

// Determine hostname
$scheme = $this->use_ssl ? 'https://' : 'http://';
if ($this->resource_prefix || $this->path_style) // Use bucket-in-path method.
if ($bucket_name_may_cause_ssl_wildcard_failures || $this->resource_prefix || $this->path_style) // Use bucket-in-path method.
{
$hostname = $this->hostname . $this->resource_prefix . (($bucket === '' || $this->resource_prefix === '/' . $bucket) ? '' : ('/' . $bucket));
}
Expand Down