Встроить Tomcat -7 для работы только по https

Я хочу запустить встроенный tomcat, который использует только HTTPS (8443 ). Я вообще не хочу, чтобы порт 8080 использовался. Любая идея о?


    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);

Спасибо

6
задан Srinivas 6 August 2012 в 07:41
поделиться