Merge pull request #10983 from rmuir/no_check_certificate

Let HTTPS work correctly
This commit is contained in:
Robert Muir 2015-05-05 14:47:37 -07:00
commit e4beda94f9
2 changed files with 0 additions and 35 deletions

View File

@ -33,10 +33,6 @@ import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.env.Environment;
import org.elasticsearch.node.internal.InternalSettingsPreparer;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
@ -87,34 +83,6 @@ public class PluginManager {
this.url = url;
this.outputMode = outputMode;
this.timeout = timeout;
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
@Override
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
}
};
// Install the all-trusting trust manager
try {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
} catch (Exception e) {
throw new ElasticsearchException("Failed to install all-trusting trust manager", e);
}
}
public void downloadAndExtract(String name) throws IOException {

View File

@ -68,9 +68,6 @@ grant {
// needed by ImmutableSettings
permission java.lang.RuntimePermission "getenv.*";
// needed by PluginManager
permission java.lang.RuntimePermission "setFactory";
// needed by LuceneTestCase/TestRuleLimitSysouts
permission java.lang.RuntimePermission "setIO";