From d5160bf10bc1a4e46fd71764dc91aad8fb48e903 Mon Sep 17 00:00:00 2001 From: cnr Date: Fri, 13 Jan 2017 03:07:50 -0600 Subject: [PATCH] Don't register https scheme in BungeeRotator --- .../bungee/api/DnsMadeEasyApiCallBase.java | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/Plugins/Mineplex.BungeeRotator/src/mineplex/bungee/api/DnsMadeEasyApiCallBase.java b/Plugins/Mineplex.BungeeRotator/src/mineplex/bungee/api/DnsMadeEasyApiCallBase.java index 5b6c37f5c..e8aa90d35 100644 --- a/Plugins/Mineplex.BungeeRotator/src/mineplex/bungee/api/DnsMadeEasyApiCallBase.java +++ b/Plugins/Mineplex.BungeeRotator/src/mineplex/bungee/api/DnsMadeEasyApiCallBase.java @@ -1,5 +1,7 @@ package mineplex.bungee.api; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -10,16 +12,10 @@ import java.util.Locale; import java.util.TimeZone; import java.util.concurrent.TimeUnit; -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; - import org.apache.commons.codec.binary.Hex; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpRequestBase; -import org.apache.http.conn.scheme.PlainSocketFactory; -import org.apache.http.conn.scheme.Scheme; -import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.conn.PoolingClientConnectionManager; import org.apache.http.params.BasicHttpParams; @@ -30,7 +26,7 @@ public abstract class DnsMadeEasyApiCallBase { public static final int TIMEOUT = (int) TimeUnit.SECONDS.toMillis(60); - protected String ApiUrl = "http://api.dnsmadeeasy.com/V2.0/dns/managed/"; + protected String ApiUrl = "https://api.dnsmadeeasy.com/V2.0/dns/managed/"; protected int DomainId = 962728; protected String Category = "/records/"; @@ -43,10 +39,7 @@ public abstract class DnsMadeEasyApiCallBase protected String execute(HttpRequestBase request) { - SchemeRegistry schemeRegistry = new SchemeRegistry(); - schemeRegistry.register(new Scheme("https", 80, PlainSocketFactory.getSocketFactory())); - - PoolingClientConnectionManager connectionManager = new PoolingClientConnectionManager(schemeRegistry); + PoolingClientConnectionManager connectionManager = new PoolingClientConnectionManager(); connectionManager.setMaxTotal(200); connectionManager.setDefaultMaxPerRoute(20); @@ -80,13 +73,9 @@ public abstract class DnsMadeEasyApiCallBase } catch (Exception ex) { - System.out.println("DnsMadeEasyApiCall Error:\n" + ex.getMessage()); - - for (StackTraceElement trace : ex.getStackTrace()) - { - System.out.println(trace); - } - } + System.out.println("DnsMadeEasyApiCall Error:"); + ex.printStackTrace(); + } finally { httpClient.getConnectionManager().shutdown();