From 1176b144d751efe85111b79d9a785a6e66445085 Mon Sep 17 00:00:00 2001 From: Looly Date: Thu, 22 Aug 2024 20:48:50 +0800 Subject: [PATCH] add constructor --- .../dromara/hutool/http/server/SimpleServer.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hutool-http/src/main/java/org/dromara/hutool/http/server/SimpleServer.java b/hutool-http/src/main/java/org/dromara/hutool/http/server/SimpleServer.java index 2f6eae681..f05b11794 100644 --- a/hutool-http/src/main/java/org/dromara/hutool/http/server/SimpleServer.java +++ b/hutool-http/src/main/java/org/dromara/hutool/http/server/SimpleServer.java @@ -27,6 +27,7 @@ import org.dromara.hutool.http.server.filter.HttpFilter; import org.dromara.hutool.http.server.filter.SimpleFilter; import org.dromara.hutool.http.server.handler.ActionHandler; +import javax.net.ssl.SSLContext; import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; @@ -70,7 +71,17 @@ public class SimpleServer { * @param address 监听地址 */ public SimpleServer(final InetSocketAddress address) { - this(address, null); + this(address, (HttpsConfigurator) null); + } + + /** + * 构造 + * + * @param address 监听地址 + * @param sslContext ssl配置 + */ + public SimpleServer(final InetSocketAddress address, final SSLContext sslContext) { + this(address, new HttpsConfigurator(sslContext)); } /**