Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
updated on 2023.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack253-png committed Jan 12, 2023
1 parent a8c35ff commit 3b9093c
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/main/java/com/mcreater/canimation/client/CAnimationClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,7 @@
@Environment(EnvType.CLIENT)
public class CAnimationClient implements ClientModInitializer {
public static final CommonConfig config = new CommonConfig();

public void onInitializeClient() {
trustAllHosts();

}
public static void trustAllHosts() {
TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[]{};
}
public void checkClientTrusted(X509Certificate[] chain, String authType) {}
public void checkServerTrusted(X509Certificate[] chain, String authType) {}
}
};
try {
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
} catch (Exception e) {
e.printStackTrace();
}
}
}

0 comments on commit 3b9093c

Please sign in to comment.