src/MessageValidator.php
private function validateUrl($url)
    {
        $parsed = parse_url($url);
        if (empty($parsed['scheme'])
            || empty($parsed['host'])
            || $parsed['scheme'] !== 'https'
            || substr($url, -4) !== '.pem'
            || !preg_match($this->hostPattern, $parsed['host'])
        ) {
            throw new InvalidSnsMessageException(
                'The certificate is located on an invalid domain.'
            );
        }
    }
private function validateUrl($url)
    {
        $parsed = parse_url($url);
        if (empty($parsed['scheme'])
            || empty($parsed['host'])
            || $parsed['scheme'] !== 'https'
            || substr($url, -4) !== '.pem'
            || !preg_match($this->hostPattern, $parsed['host'])
        ) {
            throw new InvalidSnsMessageException(
                'The certificate is located on an invalid domain.'
            );
        }
    }
private function validateUrl ( $ url ) { $ parsed = parse_url ( $ url ) ; if ( empty ( $ parsed [ 'scheme' ] ) || empty ( $ parsed [ 'host' ] ) || $ parsed [ 'scheme' ] !== 'https' || substr ( $ url , - 4 ) !== '.pem' || ! preg_match ( $ this -> hostPattern , $ parsed [ 'host' ] ) ) { throw new InvalidSnsMessageException ( 'The certificate is located on an invalid domain.' ) ; } }
Ensures that the URL of the certificate is one belonging to AWS, and not
just something from the amazonaws domain, which could include S3 buckets.

@param string $url Certificate URL

@throws InvalidSnsMessageException if the cert url is invalid.
Ensures that the URL of the certificate is one belonging to AWS and not just something from the amazonaws domain which could include S3 buckets .