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

Let HTTPS work correctly #10983

Merged
merged 1 commit into from May 5, 2015
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
32 changes: 0 additions & 32 deletions src/main/java/org/elasticsearch/plugins/PluginManager.java
Expand Up @@ -33,10 +33,6 @@
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;
Expand Down Expand Up @@ -87,34 +83,6 @@ public PluginManager(Environment environment, String url, OutputMode outputMode,
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 {
Expand Down
Expand Up @@ -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";

Expand Down