mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-20 11:09:39 +00:00
Add workaround for #42
This commit is contained in:
1 parent
f78a3b2565
commit
47de6d3a89
5 files changed
+54
-11
No files matched your search
@@ -2,6 +2,6 @@ minecraft_version=1.13.1
|
||||
minecraft_full_versions=1.13.1
|
||||
#forge gradle needs forge version
|
||||
forge_mc_version=1.12.2
|
||||
forge_version=14.23.4.2705
|
||||
forge_version=14.23.5.2768
|
||||
mappings_version=stable_39
|
||||
srg_notch_map=1.13.1.srg
|
||||
@@ -2,6 +2,6 @@ minecraft_version=1.13.2
|
||||
minecraft_full_versions=1.13.2
|
||||
#forge gradle needs forge version
|
||||
forge_mc_version=1.12.2
|
||||
forge_version=14.23.4.2705
|
||||
forge_version=14.23.5.2768
|
||||
mappings_version=stable_39
|
||||
srg_notch_map=1.13.2.srg
|
||||
@@ -2,6 +2,6 @@ minecraft_version=1.13
|
||||
minecraft_full_versions=1.13
|
||||
#forge gradle needs forge version
|
||||
forge_mc_version=1.12.2
|
||||
forge_version=14.23.4.2705
|
||||
forge_version=14.23.5.2768
|
||||
mappings_version=stable_39
|
||||
srg_notch_map=1.13.srg
|
||||
@@ -1,15 +1,12 @@
|
||||
package customskinloader.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.UnknownHostException;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import javax.net.ssl.*;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -37,7 +34,8 @@ public class HttpUtil0 {
|
||||
try {
|
||||
SSLContext sc = SSLContext.getInstance("TLS");
|
||||
sc.init(null, trustAllCerts, new java.security.SecureRandom());
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
||||
//HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(new SSLSocketFactoryFacade());
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(doNotVerify);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -76,4 +74,49 @@ public class HttpUtil0 {
|
||||
num+=Integer.parseInt(ips[i])*(256^(3-i));
|
||||
return num;
|
||||
}
|
||||
|
||||
//https://stackoverflow.com/questions/30817934/extended-server-name-sni-extension-not-sent-with-jdk1-8-0-but-send-with-jdk1-7
|
||||
public static class SSLSocketFactoryFacade extends SSLSocketFactory {
|
||||
|
||||
SSLSocketFactory sslsf;
|
||||
|
||||
public SSLSocketFactoryFacade() {
|
||||
sslsf = (SSLSocketFactory) SSLSocketFactory.getDefault();;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDefaultCipherSuites() {
|
||||
return sslsf.getDefaultCipherSuites();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedCipherSuites() {
|
||||
return sslsf.getSupportedCipherSuites();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(Socket socket, String s, int i, boolean b) throws IOException {
|
||||
return sslsf.createSocket(socket, s, i, b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(String s, int i) throws IOException, UnknownHostException {
|
||||
return sslsf.createSocket(s, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(String s, int i, InetAddress inetAddress, int i1) throws IOException, UnknownHostException {
|
||||
return sslsf.createSocket(s, i, inetAddress, i1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(InetAddress inetAddress, int i) throws IOException {
|
||||
return createSocket(inetAddress, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress1, int i1) throws IOException {
|
||||
return createSocket(inetAddress, i, inetAddress1, i1);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -14,7 +14,7 @@ buildscript {
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
|
||||
ext.MINECRAFT_VERSION = "1.12.2"
|
||||
ext.FORGE_VERSION = "14.23.4.2705"
|
||||
ext.FORGE_VERSION = "14.23.5.2768"
|
||||
ext.MAPPING_VERSION = "stable_39"
|
||||
ext.MINECRAFT_FULL_VERSIONS = "1.8,1.8.8,1.8.9,1.9,1.9.4,1.10,1.10.2,1.11,1.11.2,1.12,1.12.1,1.12.2"
|
||||
|
||||
|
||||
Reference in new issue
Block a user