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