Track change to Conscrypt

Change way in which an outside caller can get the preferred SSLContext.

(cherry picked from commit 8a97063720)

Bug: 19798387
Bug: 17136008
Change-Id: Ide578664bcb605304322bfddd2e640a63042fa09
This commit is contained in:
Kenny Root
2014-10-31 10:28:04 -07:00
parent 842eee9f81
commit 693ea60e9e
3 changed files with 4 additions and 4 deletions

View File

@@ -208,7 +208,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory {
private SSLSocketFactory makeSocketFactory(
KeyManager[] keyManagers, TrustManager[] trustManagers) {
try {
OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
OpenSSLContextImpl sslContext = OpenSSLContextImpl.getPreferred();
sslContext.engineInit(keyManagers, trustManagers, null);
sslContext.engineGetClientSessionContext().setPersistentCache(mSessionCache);
return sslContext.engineGetSocketFactory();

View File

@@ -79,7 +79,7 @@ public class HttpsConnection extends Connection {
cache = FileClientSessionCache.usingDirectory(sessionDir);
}
OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
OpenSSLContextImpl sslContext = OpenSSLContextImpl.getPreferred();
// here, trust managers is a single trust-all manager
TrustManager[] trustManagers = new TrustManager[] {

View File

@@ -907,7 +907,7 @@ public class SSLSocketTest extends TestCase {
*/
public void testClientSessionCaching() throws IOException,
KeyManagementException {
OpenSSLContextImpl context = new OpenSSLContextImpl();
OpenSSLContextImpl context = OpenSSLContextImpl.getPreferred();
// Cache size = 2.
FakeClientSessionCache fakeCache = new FakeClientSessionCache();
@@ -1000,7 +1000,7 @@ public class SSLSocketTest extends TestCase {
public void testFileBasedClientSessionCache() throws IOException,
KeyManagementException {
OpenSSLContextImpl context = new OpenSSLContextImpl();
OpenSSLContextImpl context = OpenSSLContextImpl.getPreferred();
String tmpDir = System.getProperty("java.io.tmpdir");
if (tmpDir == null) {
fail("Please set 'java.io.tmpdir' system property.");