//Obtain an instance of SslTrustVerifier
SslTrustVerifier verifier = new SslTrustVerifier();
//Verify that instances of HttpsEndpoint and SslEndpoint
//with no socket factories are trusted.
int port = Integer.parseInt(getStringValue("listenPort"));
HttpsEndpoint httpsEndpoint = HttpsEndpoint.getInstance(
InetAddress.getLocalHost().getHostAddress(), port);
TestTrustVerifierCtxSSL ctx = new TestTrustVerifierCtxSSL();
if (!verifier.isTrustedObject(httpsEndpoint,ctx)){
throw new TestException("HttpsEndpoint instance"
+ " with no socket factory is considered untrusted");