HTTPS (8443) のみを使用する組み込みの tomcat を実行したいと考えています。8080 ポートをまったく使用したくありません。について何か考えはありますか?
コネクタ 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);
コネクタ defaultConnector = tomcat.getConnector();
defaultConnector.setRedirectPort(8443);
tomcat.setBaseDir(".");
tomcat.getHost().setAppBase(appBase);
StandardServer サーバー = (StandardServer) tomcat.getServer();
AprLifecycleListener リスナー = 新しい AprLifecycleListener();
server.addLifecycleListener(リスナー);
ありがとう