Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-20431] (3_5_X) Remove NonValidatingTrustManager. #7789

Merged
merged 1 commit into from Mar 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

This file was deleted.

Expand Up @@ -549,16 +549,7 @@ public int getReadyState()

public boolean validatesSecureCertificate()
{
if (proxy.hasProperty("validatesSecureCertificate")) {
return TiConvert.toBoolean(proxy.getProperty("validatesSecureCertificate"));

} else {
if (TiApplication.getInstance().getDeployType().equals(
TiApplication.DEPLOY_TYPE_PRODUCTION)) {
return true;
}
}
return false;
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a deprecation warning here so we can remove it in 6.0

}

public void addAuthFactory(String scheme, AuthSchemeFactory theFactory)
Expand Down Expand Up @@ -1110,14 +1101,6 @@ protected DefaultHttpClient getClient(boolean validating)
Log.e(TAG, "Error creating SSLSocketFactory: " + e.getMessage());
sslSocketFactory = null;
}
} else if (!validating) {
TrustManager trustManagerArray[] = new TrustManager[] { new NonValidatingTrustManager() };
try {
sslSocketFactory = new TiSocketFactory(null, trustManagerArray);
} catch(Exception e) {
Log.e(TAG, "Error creating SSLSocketFactory: " + e.getMessage());
sslSocketFactory = null;
}
}
}

Expand All @@ -1127,8 +1110,6 @@ protected DefaultHttpClient getClient(boolean validating)

if (sslSocketFactory != null) {
client.getConnectionManager().getSchemeRegistry().register(new Scheme("https", sslSocketFactory, 443));
} else if (!validating) {
client.getConnectionManager().getSchemeRegistry().register(new Scheme("https", new NonValidatingSSLSocketFactory(), 443));
} else {
client.getConnectionManager().getSchemeRegistry().register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
}
Expand Down