Revert "Allow SSL caches to be installed directly on SSLContexts."

This reverts commit 25bef03cbf.

Breaks build with
 cannot access com.android.org.conscrypt.SSLClientSessionCache
class file for com.android.org.conscrypt.SSLClientSessionCache not found

Change-Id: I6a89b45d5e8c7547778d7485ed02006cd4679989
This commit is contained in:
Narayan Kamath
2013-09-09 16:46:16 +00:00
parent 25bef03cbf
commit fdf4bbf2d0
2 changed files with 1 additions and 141 deletions

View File

@@ -19,16 +19,12 @@ package android.net;
import android.content.Context;
import android.util.Log;
import com.android.org.conscrypt.ClientSessionContext;
import com.android.org.conscrypt.FileClientSessionCache;
import com.android.org.conscrypt.SSLClientSessionCache;
import java.io.File;
import java.io.IOException;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSessionContext;
/**
* File-based cache of established SSL sessions. When re-establishing a
* connection to the same server, using an SSL session cache can save some time,
@@ -41,34 +37,6 @@ public final class SSLSessionCache {
private static final String TAG = "SSLSessionCache";
/* package */ final SSLClientSessionCache mSessionCache;
/**
* Installs a {@link SSLSessionCache} on a {@link SSLContext}. The cache will
* be used on all socket factories created by this context (including factories
* created before this call).
*
* @param cache the cache instance to install, or {@code null} to uninstall any
* existing cache.
* @param context the context to install it on.
* @throws IllegalArgumentException if the context does not support a session
* cache.
*
* @hide candidate for public API
*/
public static void install(SSLSessionCache cache, SSLContext context) {
SSLSessionContext clientContext = context.getClientSessionContext();
if (clientContext instanceof ClientSessionContext) {
((ClientSessionContext) clientContext).setPersistentCache(
cache == null ? null : cache.mSessionCache);
} else {
throw new IllegalArgumentException("Incompatible SSLContext: " + context);
}
}
/** @hide For unit test use only */
public SSLSessionCache(SSLClientSessionCache cache) {
mSessionCache = cache;
}
/**
* Create a session cache using the specified directory.
* Individual session entries will be files within the directory.
@@ -78,7 +46,7 @@ public final class SSLSessionCache {
* @throws IOException if the cache can't be opened
*/
public SSLSessionCache(File dir) throws IOException {
this(FileClientSessionCache.usingDirectory(dir));
mSessionCache = FileClientSessionCache.usingDirectory(dir);
}
/**