From 2df8625b24181912d28bbe330fc5783d079751a6 Mon Sep 17 00:00:00 2001 From: Jaida Wu Date: Thu, 21 Apr 2022 22:21:28 +0800 Subject: [PATCH] Fallback to HTTP if no SSL cert Signed-off-by: Jaida Wu --- .../java/emu/grasscutter/server/dispatch/DispatchServer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java index b4d4993d8..392609a07 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java +++ b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java @@ -142,8 +142,9 @@ public final class DispatchServer { httpsServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); server = httpsServer; } catch (Exception e) { - Grasscutter.getLogger().error("No SSL cert found!"); - return; + Grasscutter.getLogger().error("No SSL cert found! Falling back to HTTP server."); + Grasscutter.getConfig().UseSSL = false; + server = HttpServer.create(getAddress(), 0); } } else { server = HttpServer.create(getAddress(), 0);