Wildfly 10 HTTPS 证书在 8443 上正常,但在 443 上表示证书错误

Wildfly 10 HTTPS certificate fine on 8443 but on 443 says bad certificate

我正在尝试将 Wildfly (10) 配置为对 HTTPS 使用 SSL 证书。它似乎适用于 8443(使用 https://example.com:8443 -- no errors and certificate shows it is signed by the CA), but when I switch the HTTPS to port 443, whenever I access the site (via https://example.com 它告诉我我的证书安装不正确,连接不安全并且它使用的是自签名密钥)。

以下是我的 standalone.xml 文件中的片段:

安全领域

       <security-realm name="ApplicationRealm">
            <server-identities>
                <ssl>
                    <keystore path="devifs.jks" relative-to="jboss.server.config.dir" keystore-password="yadayada" alias="tomcat" key-password="yadayada"/>
                </ssl>
            </server-identities>
            <authentication>
                <local default-user="$local" allowed-users="*" skip-group-loading="true"/>
                <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
            </authentication>
            <authorization>
                <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
            </authorization>
        </security-realm>

Undertow 子系统

   <subsystem xmlns="urn:jboss:domain:undertow:3.0">
        <buffer-cache name="default"/>
        <server name="default-server">
            <http-listener name="default" socket-binding="http" redirect-socket="https"/>
            <https-listener name="default-ssl" security-realm="ApplicationRealm" socket-binding="https"/>
            <host name="default-host" default-web-module="hatteras.war" alias="localhost">
                <location name="/" handler="welcome-content"/>
                <location name="/reports/" handler="ifsreports"/>
                <filter-ref name="server-header"/>
                <filter-ref name="x-powered-by-header"/>
            </host>
         </server>
            ....
     </subsystem>

套接字绑定组

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
    <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
    <socket-binding name="http" port="${jboss.http.port:8080}"/>
    <socket-binding name="https" port="${jboss.https.port:443}"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
</socket-binding-group>

在进行 standalone.xml 更改后,我重新启动了 Wildfly,甚至重新启动了服务器。运气不好。

堆栈:

有什么建议吗?

我的 SSL 联系人指出 JBoss 不能 运行 在 443 上,因为它是特权端口。这引导我进行研究,我发现我应该使用以下方法重定向端口:iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443 这是正确的方法吗?似乎工作正常。