protected function normalizeHost($url)
    {
        $host = (false!==strpos($url, '/')) ? parse_url($url, PHP_URL_HOST) : $url;
        $parts = explode('.', $host);
        $utf8Host = '';
        foreach ($parts as $part) {
            $utf8Host = $utf8Host . (($utf8Host === '') ? '' : '.') . $this->convertPunycode($part);
        }

        return mb_strtolower($utf8Host);
    }