Verify hostname according to rfc2818

Without this check HTTPS connection is vulnerable to MITM attack when the attacker would return a valid certificate but from wrong host.