mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-21 05:50:18 +08:00
Fix Keystore
This commit is contained in:
parent
91297a691b
commit
e0d24b4517
@ -48,7 +48,7 @@ public enum Settings {
|
||||
ANALYSIS_EXPORT_PATH("Settings.Analysis.Export.DestinationFolder"),
|
||||
WEBSERVER_CERTIFICATE_PATH("Settings.WebServer.Security.Certificate.KeyStorePath"),
|
||||
WEBSERVER_CERTIFICATE_KEYPASS("Settings.WebServer.Security.Certificate.KeyPass"),
|
||||
WEBSERVER_CERTIFICATE_STOREPASS("Settings.WebServer.Security.Certificate.KeyPass"),
|
||||
WEBSERVER_CERTIFICATE_STOREPASS("Settings.WebServer.Security.Certificate.StorePass"),
|
||||
WEBSERVER_CERTIFICATE_ALIAS("Settings.WebServer.Security.Certificate.Alias"),
|
||||
LINK_PROTOCOL("Settings.WebServer.ExternalWebServerLinkProtocol"),
|
||||
//
|
||||
|
@ -72,6 +72,7 @@ public class WebServer {
|
||||
Log.debug(usingHttps ? "Https Start Successful." : "Https Start Failed.");
|
||||
|
||||
if (!usingHttps) {
|
||||
Log.infoColor(ChatColor.YELLOW + "User Authorization Disabled! (Not possible over http)");
|
||||
server = HttpServer.create(new InetSocketAddress(port), 10);
|
||||
}
|
||||
|
||||
@ -171,7 +172,7 @@ public class WebServer {
|
||||
private boolean startHttpsServer() throws IOException {
|
||||
String keyStorePath = Settings.WEBSERVER_CERTIFICATE_PATH.toString();
|
||||
if (!Paths.get(keyStorePath).isAbsolute()) {
|
||||
keyStorePath = plugin.getDataFolder() + keyStorePath;
|
||||
keyStorePath = plugin.getDataFolder() + File.separator + keyStorePath;
|
||||
}
|
||||
char[] storepass = Settings.WEBSERVER_CERTIFICATE_STOREPASS.toString().toCharArray();
|
||||
char[] keypass = Settings.WEBSERVER_CERTIFICATE_KEYPASS.toString().toCharArray();
|
||||
@ -216,7 +217,9 @@ public class WebServer {
|
||||
} catch (FileNotFoundException e) {
|
||||
Log.infoColor(ChatColor.YELLOW + "WebServer: SSL Certificate KeyStore File not Found: " + keyStorePath);
|
||||
Log.info("No Certificate -> Using Http server for Visualization.");
|
||||
Log.infoColor(ChatColor.YELLOW + "User Authorization Disabled! (Not possible over http)");
|
||||
} catch (IOException e) {
|
||||
Log.error("WebServer: " + e);
|
||||
Log.toLog(this.getClass().getName(), e);
|
||||
} catch (KeyStoreException | CertificateException | UnrecoverableKeyException e) {
|
||||
Log.error("WebServer: SSL Certificate loading Failed.");
|
||||
Log.toLog(this.getClass().getName(), e);
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user