dockerapache-tomeetomee-8

How to enable https on a Tomee docker container?


I'm running a tomee(8.0.1) docker image version and I would like to enable ssl on it.

I have seen these topics:

  1. https://mkyong.com/tomcat/how-to-configure-tomcat-to-support-ssl-or-https/
  2. how to make java - tomee application HTTPS?
  3. How to enable HTTPS on Tomcat in a Docker Container?

The first and the second ways are what I tried but it did not work. Even after the restart of my container.

The second is not the way I want to do it. My idea is to configure my server and have it on my repository as an image.

Here under, the configuration I added on my server.xml:

    <!-- To generate a keystore certificate, here is the command:
         keytool -genkey -alias fnsanzabandi -keyalg RSA -keystore fnsanzabandikeystore
    -->
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
         maxThreads="150" scheme="https" secure="true"
         clientAuth="false" sslProtocol="TLS"
         keystoreFile="conf/fnsanzabandikeystore"
         keystorePass="changeit" />

May be I missed something, or there is something else to do in the tomee case.

Can you please help me?

Thank you in advance.


Solution

  • Ok. My problem was silly. After that configuration I kept running my tomcat container on port 8080 like this:

    docker run --name tomee3 -p 8080:8080 fayabobo/tomee:1.2
    

    That is why my my https port 8443 was not accessible. To resolve the problem, I just runned my tomcat container on port 8443 like this:

    docker run --name tomee4 -p 8443:8443 fayabobo/tomee:1.2
    

    And: enter image description here