如何在Tomee码头集装箱上启用https?

问题描述 投票:0回答:1

我正在运行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" />

也许我错过了某些事情,或者在前案中还有其他事情要做。

您能帮我吗?

先谢谢您。

docker tomee apache-tomee tomee-8
1个回答
0
投票

好我的问题很傻。配置完成后,我继续在端口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

和:enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.