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 { 
Connect your IDE to all the code out there  Get Codota for Java