1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 09:52:16 -05:00

Removed some commented lines of code-- testing check in to the mainline

This commit is contained in:
Bradley Young 2008-12-04 22:15:43 +00:00
parent c21097af65
commit b8e686039f

View File

@ -26,11 +26,11 @@ public final class TrustManagerFactory {
private static X509TrustManager defaultTrustManager; private static X509TrustManager defaultTrustManager;
private static X509TrustManager unsecureTrustManager; private static X509TrustManager unsecureTrustManager;
private static X509TrustManager localTrustManager; private static X509TrustManager localTrustManager;
private static SecureX509TrustManager secureTrustManager; private static SecureX509TrustManager secureTrustManager;
private static X509Certificate[] lastCertChain = null; private static X509Certificate[] lastCertChain = null;
private static File keyStoreFile; private static File keyStoreFile;
private static KeyStore keyStore; private static KeyStore keyStore;
@ -50,8 +50,6 @@ public final class TrustManagerFactory {
} }
private static class SecureX509TrustManager implements X509TrustManager { private static class SecureX509TrustManager implements X509TrustManager {
//private static X509TrustManager mTrustManager;
//private static X509TrustManager mLocalTrustManager;
private static String mHost; private static String mHost;
private static SecureX509TrustManager me; private static SecureX509TrustManager me;
@ -69,19 +67,14 @@ public final class TrustManagerFactory {
public static void setHost(String host){ public static void setHost(String host){
mHost = host; mHost = host;
} }
//
// public static void updateTrustManager(X509TrustManager trustManager) {
// mTrustManager = trustManager;
// }
public void checkClientTrusted(X509Certificate[] chain, String authType) public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException { throws CertificateException {
defaultTrustManager.checkClientTrusted(chain, authType); defaultTrustManager.checkClientTrusted(chain, authType);
} }
public void checkServerTrusted(X509Certificate[] chain, String authType) public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException { throws CertificateException {
TrustManagerFactory.setLastCertChain(chain); TrustManagerFactory.setLastCertChain(chain);
try { try {
defaultTrustManager.checkServerTrusted(chain, authType); defaultTrustManager.checkServerTrusted(chain, authType);
@ -97,7 +90,7 @@ public final class TrustManagerFactory {
} catch (KeyStoreException e) { } catch (KeyStoreException e) {
throw new CertificateException("Certificate cannot be verified; KeyStore Exception: " + e); throw new CertificateException("Certificate cannot be verified; KeyStore Exception: " + e);
} }
throw new CertificateException("Certificate domain name does not match " throw new CertificateException("Certificate domain name does not match "
+ mHost); + mHost);
} }
} }
@ -167,11 +160,11 @@ public final class TrustManagerFactory {
return secure ? SecureX509TrustManager.getInstance(host) : return secure ? SecureX509TrustManager.getInstance(host) :
unsecureTrustManager; unsecureTrustManager;
} }
public static KeyStore getKeyStore() { public static KeyStore getKeyStore() {
return keyStore; return keyStore;
} }
public static void setLastCertChain(X509Certificate[] chain) { public static void setLastCertChain(X509Certificate[] chain) {
lastCertChain = chain; lastCertChain = chain;
} }