Code example for X509TrustManager

Methods: checkServerTrusted

    	try {  
    		// Validate the server certificate 
    		try {  
    			mDefaultTrustManager.checkServerTrusted(certificates, authType); 
    		} catch (CertificateException e) { 
    			mLocalTrustManager.checkServerTrusted(new X509Certificate[] {certificates[0]}, authType);
    	} catch(CertificateException e) { 
        	// Add the untrusted certificates to send it to the gui thread. 
    		errorMsg.obj = certificates;
    	// Sends the null message in case of valid certificates or the untrusted certificates to the gui thread 
    	finally { 
Contextual code suggestions in your IDE  Get Codota for Java