で実行します。私は8080ポートをまったく使用したくありません。 ご存知ですか?あなたが8080にバインドし、[Tomcatの-DIR] /conf/server.xmlで定義されたコネクタを削除し、HTTPS用に別のコネクタを持っている必要があります埋め込みTomcatの-7は、私が唯一のHTTPS(8443)を使用して埋め込まれたTomcatを実行する場合にのみ、HTTPS
Connector httpsConnector = new Connector(); httpsConnector.setPort(httpsPort); httpsConnector.setSecure(true); httpsConnector.setScheme("https"); httpsConnector.setAttribute("keystoreFile", appBase + "/.keystore"); httpsConnector.setAttribute("clientAuth", "false"); httpsConnector.setAttribute("sslProtocol", "TLS"); httpsConnector.setAttribute("SSLEnabled", true); Tomcat tomcat = new Tomcat(); tomcat.getService().addConnector(httpsConnector); tomcat.setPort(8080); Connector defaultConnector = tomcat.getConnector(); defaultConnector.setRedirectPort(8443); tomcat.setBaseDir("."); tomcat.getHost().setAppBase(appBase); StandardServer server = (StandardServer) tomcat.getServer(); AprLifecycleListener listener = new AprLifecycleListener(); server.addLifecycleListener(listener);
おかげ
8080ポートを禁止することはできましたか? –