Code example for X509TrustManager

Methods: checkServerTrusted

0
    	 
    	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 { 
        	mCertificateHandler.sendMessage(errorMsg);
        } 
        	 
    }