mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 23:06:00 +00:00
Revert "bugfix: portbind error when falling back to http server"
This reverts commit 4817ed9c52
.
the bugfix is inappropriate
This commit is contained in:
parent
4837ccb983
commit
21b3ac103a
@ -200,6 +200,8 @@ public final class DispatchServer {
|
|||||||
public void start() throws Exception {
|
public void start() throws Exception {
|
||||||
HttpServer server;
|
HttpServer server;
|
||||||
if (Grasscutter.getConfig().getDispatchOptions().UseSSL) {
|
if (Grasscutter.getConfig().getDispatchOptions().UseSSL) {
|
||||||
|
HttpsServer httpsServer = HttpsServer.create(getAddress(), 0);
|
||||||
|
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||||
try (FileInputStream fis = new FileInputStream(Grasscutter.getConfig().getDispatchOptions().KeystorePath)) {
|
try (FileInputStream fis = new FileInputStream(Grasscutter.getConfig().getDispatchOptions().KeystorePath)) {
|
||||||
char[] keystorePassword = Grasscutter.getConfig().getDispatchOptions().KeystorePassword.toCharArray();
|
char[] keystorePassword = Grasscutter.getConfig().getDispatchOptions().KeystorePassword.toCharArray();
|
||||||
KeyManagerFactory _kmf;
|
KeyManagerFactory _kmf;
|
||||||
@ -232,9 +234,9 @@ public final class DispatchServer {
|
|||||||
throw originalEx;
|
throw originalEx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
|
||||||
sslContext.init(_kmf.getKeyManagers(), null, null);
|
sslContext.init(_kmf.getKeyManagers(), null, null);
|
||||||
HttpsServer httpsServer = HttpsServer.create(getAddress(), 0);
|
|
||||||
httpsServer.setHttpsConfigurator(new HttpsConfigurator(sslContext));
|
httpsServer.setHttpsConfigurator(new HttpsConfigurator(sslContext));
|
||||||
server = httpsServer;
|
server = httpsServer;
|
||||||
} catch (BindException ignored) {
|
} catch (BindException ignored) {
|
||||||
|
Loading…
Reference in New Issue
Block a user