zengkid / SmartTomcat

The Tomcat plugin for Intellij IDEA
Apache License 2.0
126 stars 55 forks source link

Missing https Port configuration #123

Closed emi-emi671 closed 8 months ago

emi-emi671 commented 8 months ago

Is this plugin support running the server over https?

yuezk commented 8 months ago

Yes. But need some configurations, below are my configurations.

  1. Prepare the certificate (I'm using mkcert to generate the dev certs)
  2. Configure the <Tomcat Home>/conf/server.xml for the Tomcat server you selected.
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true"
            compression="on"
            compressableMimeType="text/html,text/json,application/json,text/xml,text/plain,application/javascript,text/css,text/javascript,text/js"
            useSendfile="false"
            compressionMinSize="500"
            >
        <!--<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />-->
        <SSLHostConfig>
            <Certificate certificateKeyFile="/path/to/localhost+3-key.pem"
                         certificateFile="/path/to/localhost+3.pem"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
  3. Configure the SSL port in the Tomcat Configuration of IntelliJ image
  4. Start the Tomcat, you could see the URL printed.
emi-emi671 commented 8 months ago

Thanks for sharing this, it seems to be working now after adding Connector port="8443" in server.xml.

yuezk commented 8 months ago

Glad it works for you. Closing.