【问题标题】:How to enable https on a Tomee docker container?如何在 Tomee docker 容器上启用 https?
【发布时间】:2020-04-26 09:32:36
【问题描述】:

我正在运行一个 tomee(8.0.1) docker 镜像版本,我想在它上面启用 ssl。

我看过这些话题:

  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?

第一种和第二种方法是我尝试过的,但没有奏效。即使在我的容器重新启动之后。

第二个不是我想要的方式。我的想法是配置我的服务器并将其作为图像放在我的存储库中。

下面是我在 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" />

可能是我错过了什么,或者在 tomee 案例中还有其他事情要做。

你能帮帮我吗?

提前谢谢你。

【问题讨论】:

    标签: docker apache-tomee tomee-8


    【解决方案1】:

    好的。我的问题很愚蠢。 在该配置之后,我继续在端口 8080 上运行我的 tomcat 容器,如下所示:

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

    这就是我的 https 端口 8443 无法访问的原因。为了解决这个问题,我只是在端口 8443 上运行了我的 tomcat 容器,如下所示:

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

    并且:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-05
      • 2020-08-03
      • 2020-10-04
      • 1970-01-01
      • 1970-01-01
      • 2016-01-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多