domain.setPeerAuthentication(SslDomain.VerifyMode.VERIFY_PEER);
//domain.setPeerAuthentication(SslDomain.VerifyMode.VERIFY_PEER_NAME);
} else {
domain.setPeerAuthentication(SslDomain.VerifyMode.ANONYMOUS_PEER);
}
Ssl ssl = transport.ssl(domain);
//ssl.setPeerHostname(host);
}
connection.open();
}