From cfd86c67670ff824e0ed9e3c7851d038d44b9270 Mon Sep 17 00:00:00 2001 From: zhengjw22 Date: Thu, 7 Nov 2024 20:07:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smartboot/servlet/tck/SmartEmbeddedContainer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tck/src/main/java/tech/smartboot/servlet/tck/SmartEmbeddedContainer.java b/tck/src/main/java/tech/smartboot/servlet/tck/SmartEmbeddedContainer.java index 1523a76..912231c 100644 --- a/tck/src/main/java/tech/smartboot/servlet/tck/SmartEmbeddedContainer.java +++ b/tck/src/main/java/tech/smartboot/servlet/tck/SmartEmbeddedContainer.java @@ -34,7 +34,7 @@ import org.smartboot.http.server.impl.WebSocketRequestImpl; import org.smartboot.http.server.impl.WebSocketResponseImpl; import org.smartboot.socket.extension.plugins.SslPlugin; -import org.smartboot.socket.extension.ssl.factory.PemServerSSLContextFactory; +import org.smartboot.socket.extension.ssl.factory.ServerSSLContextFactory; import tech.smartboot.servlet.Container; import tech.smartboot.servlet.ServletContextRuntime; import tech.smartboot.servlet.conf.ServletInfo; @@ -126,8 +126,9 @@ public void handle(WebSocketRequest request, WebSocketResponse response) { if (containerConfig.isSsl()) { try { -// ServerSSLContextFactory sslPlugin = new ServerSSLContextFactory(new FileInputStream(containerConfig.getKeystorePath()), "changeit", "changeit"); - PemServerSSLContextFactory sslPlugin = new PemServerSSLContextFactory(new FileInputStream("/Users/zhengjw22mac123/IdeaProjects/smart-servlet/tck/src/test/resources/smart-servlet.pem")); + ServerSSLContextFactory sslPlugin = new ServerSSLContextFactory(new FileInputStream(containerConfig.getKeystorePath()), "changeit", "changeit"); +// PemServerSSLContextFactory sslPlugin = new PemServerSSLContextFactory(new FileInputStream("/Users/zhengjw22mac123/IdeaProjects/smart-servlet/tck/src/test/resources/smart-servlet.pem")); + bootstrap.configuration().host(containerConfig.getBindAddress()); bootstrap.configuration().addPlugin(new SslPlugin<>(sslPlugin, new Consumer() { @Override public void accept(SSLEngine sslEngine) { @@ -142,8 +143,7 @@ public void accept(SSLEngine sslEngine) { } bootstrap.configuration().setHttpIdleTimeout(120000); bootstrap.setPort(containerConfig.getBindHttpPort()).start(); - listeningHost = "127.0.0.1"; -// listeningHost = containerConfig.getBindAddress(); + listeningHost = containerConfig.getBindAddress(); listeningPort = containerConfig.getBindHttpPort(); System.out.println("host: " + listeningHost + " port:" + listeningPort + " ssl:" + containerConfig.isSsl()); }