mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
Fixed cacerts reading issue. Symbols and images should now downloaded properly. For #9135 and #9401.
This commit is contained in:
parent
9d54aee3ba
commit
65ed0f84fc
2 changed files with 14 additions and 2 deletions
|
@ -73,6 +73,7 @@ import java.io.InputStream;
|
|||
import java.net.SocketException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Executors;
|
||||
|
@ -192,8 +193,19 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
* Creates new form MageFrame
|
||||
*/
|
||||
public MageFrame() throws MageException {
|
||||
System.setProperty("javax.net.ssl.trustStore", System.getProperty("user.dir") + "/src/main/resources/cacerts".replace('/', File.separatorChar));
|
||||
File cacertsFile = new File(System.getProperty("user.dir") + "/release/cacerts").getAbsoluteFile();
|
||||
if (!cacertsFile.exists()) { // When running from the jar file the contents of the /release folder will have been expanded into the home folder as part of packaging
|
||||
cacertsFile = new File(System.getProperty("user.dir") + "/cacerts").getAbsoluteFile();
|
||||
}
|
||||
if (cacertsFile.exists()) {
|
||||
LOGGER.info("Custom (or bundled) Java certificate file (cacerts) file found");
|
||||
String cacertsPath = cacertsFile.getPath();
|
||||
System.setProperty("javax.net.ssl.trustStore", cacertsPath);
|
||||
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
|
||||
} else {
|
||||
LOGGER.info("custom Java certificate file not found at: " + cacertsFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
setWindowTitle();
|
||||
|
||||
EDTExceptionHandler.registerExceptionHandler();
|
||||
|
|
Loading…
Reference in a new issue