def METHOD_NAME(self, storage_url, ssl_context):
    hit = re.match(r'^s3s?://([^/]+)/([^/]+)(?:/(.*))?$', storage_url)
    if not hit:
        raise QuietError('Invalid storage URL', exitcode=2)
    self.region = hit.group(1)
    bucket_name = hit.group(2)
    # http://docs.amazonwebservices.com/AmazonS3/2006-03-01/dev/BucketRestrictions.html
    if not re.match('^[a-z0-9][a-z0-9.-]{1,60}[a-z0-9]$', bucket_name):
        raise QuietError('Invalid bucket name.', exitcode=2)
    if self.region.startswith('cn-'):
        hostname = 's3.%s.amazonaws.com.cn' % self.region
    else:
        hostname = 's3.%s.amazonaws.com' % self.region
    prefix = hit.group(3) or ''
    port = 443 if ssl_context else 80
    return (hostname, port, bucket_name, prefix)