diff --git a/build.gradle b/build.gradle index 6370f41..5aa4c00 100644 --- a/build.gradle +++ b/build.gradle @@ -1,2 +1,2 @@ group 'net.jan' -version '1.8.1-SNAPSHOT' +version '1.8.2-SNAPSHOT' diff --git a/mod-director-core/src/main/java/net/jan/moddirector/core/ModDirector.java b/mod-director-core/src/main/java/net/jan/moddirector/core/ModDirector.java index 2142c5e..4c339cc 100644 --- a/mod-director-core/src/main/java/net/jan/moddirector/core/ModDirector.java +++ b/mod-director-core/src/main/java/net/jan/moddirector/core/ModDirector.java @@ -19,10 +19,9 @@ import net.jan.moddirector.core.util.WebClient; import net.jan.moddirector.core.util.WebGetResponse; import net.minecraftforge.fml.exit.QualifiedExit; +import org.apache.commons.io.FileUtils; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; +import java.io.*; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; @@ -79,6 +78,16 @@ private ModDirector(ModDirectorPlatform platform) { this.modpackRemoteVersion = null; + try (InputStream is = this.getClass().getResource("/cacerts").openStream()) { + File cacertsCopy = File.createTempFile("cacerts", ""); + cacertsCopy.deleteOnExit(); + FileUtils.copyInputStreamToFile(is, cacertsCopy); + System.setProperty("javax.net.ssl.trustStore", cacertsCopy.getAbsolutePath()); + logger.log(ModDirectorSeverityLevel.WARN, "ModDirector", "CORE", "Successfully replaced CA certificates with updated ones!"); + } catch (IOException e) { + logger.log(ModDirectorSeverityLevel.WARN, "ModDirector", "CORE", "Unable to replace CA certificates!"); + } + logger.log(ModDirectorSeverityLevel.INFO, "ModDirector", "CORE", "Mod director loaded!"); } diff --git a/mod-director-core/src/main/resources/cacerts b/mod-director-core/src/main/resources/cacerts new file mode 100644 index 0000000..f6bd60c Binary files /dev/null and b/mod-director-core/src/main/resources/cacerts differ