Code example for X509HostnameVerifier

Methods: verify

0
        if (remoteAddress instanceof InetSocketAddress) {
            address = ((InetSocketAddress) remoteAddress).getHostName();
        } else { 
            address = remoteAddress.toString();
        } 
        if (!hostnameVerifier.verify(address, sslsession)) {
            throw new SSLException("Host name verification failed for host : " + address);
        } 
 
        if (verificationManager!=null) {
            try { 
                verificationManager.verifyRevocationStatus(sslsession.getPeerCertificateChain());
            } catch (CertificateVerificationException e) {
                throw new SSLException("Certificate Chain Validation failed for host : " + address, e);
            } 
        } 
    } 
 
}