【问题标题】:Configure Https blocking http wildfly 8.2 (i.e without using security-constraint in web.xml)配置 Https 阻止 http wildfly 8.2(即在 web.xml 中不使用安全约束)
【发布时间】:2015-08-07 15:59:42
【问题描述】:

将 Jboss6 迁移到 WildFly8.2

在 wildlfy8.2 中处理 https keystone 连接。使用http://blog.eisele.net/2015/01/ssl-with-wildfly-8-and-undertow.html 在standalone-full.xml conf 上配置我的应用程序后。我能够在我的应用程序上同时访问 http 和 https 我必须单独访问 https 来阻止 http。在 web.xml 中添加 security-constraint 后,我能够重定向到 https。但我不想在新版本的 web.xml 中包含任何内容,这会影响我的旧 jboss 用户。

在某些情况下,有些人使用 jboss6 应用程序而没有 SSL 密钥库配置,而有些人在 Https 中使用相同的应用程序。 旧版本的 jboss 允许在 server.xml 本身中配置 http 和 https。在wildfly中,我们必须编辑应用程序war文件而不是服务器配置文件。

注意:我得到这个链接,在https://developer.jboss.org/thread/253008?_sscc=t 中解决了同样的问题。按照指示进行了更改。但它不起作用,我们使用的是standalone-full.xml而不是standalone.xml。

进行更改后,我收到网络服务端口错误:

jboss.deployment.subunit."XXX.ear"."XXXEJB3.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "XXXEJB3.jar" of deployment "XXX.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_31]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_31]
Caused by: java.lang.IllegalStateException: JBAS017350: Could not find the port number listening for protocol HTTP/1.1
at org.wildfly.extension.undertow.WebServerService.getPort(WebServerService.java:67)
at org.jboss.as.webservices.config.WebServerInfoImpl.getPort(WebServerInfoImpl.java:36)

【问题讨论】:

    标签: xml wildfly jboss6.x wildfly-8


    【解决方案1】:

    对于 Http 阻塞和 Https 启用,对standalone-full.xml(即自定义服务器)或standalone.xml 进行如下更改

    1:在消息传递中 - hornetq-server 子系统连接器将 http 更改为 https

    <http-connector name="http-connector" socket-binding="https">
    <http-connector name="http-connector-throughput" socket-binding="https">
    

    2: 在子系统变化中

       <http-listener name="default" socket-binding="http"/>
    

    <https-listener name="default-ssl" socket-binding="https" security-realm="UndertowRealm"/> 
    

    注意:https-listener name default-ssl在消息传递子系统 http-acceptor 和远程子系统 http-connector 中使用此名称

    3:给消息传递 - hornetq-server 子系统 http-acceptor 和远程子系统 http-connector 的 connector-ref 作为 https-listener 名称

    <subsystem xmlns="urn:jboss:domain:messaging:2.0">....
    <http-acceptor http-listener="default-ssl" name="http-acceptor"/>
    <http-acceptor http-listener="default-ssl" name="http-acceptor-throughput">...</subsystem>
    
    <subsystem xmlns="urn:jboss:domain:remoting:2.0">....
    <http-connector name="http-remoting-connector" connector-ref="default-ssl" security-realm="ApplicationRealm"/>....</subsystem>
    

    对于错误:将 modify-wsdl-address 添加到 true 并将 wsdl-port 添加到 80,而不是 https 阻止 http。

    <subsystem xmlns="urn:jboss:domain:webservices:1.2">
            <modify-wsdl-address>true</modify-wsdl-address>
            <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
            <wsdl-port>80</wsdl-port>
            <endpoint-config name="Standard-Endpoint-Config"/>
            <endpoint-config name="Recording-Endpoint-Config">
                <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                    <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
                </pre-handler-chain>
            </endpoint-config>
            <client-config name="Standard-Client-Config"/>
        </subsystem>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-18
      相关资源
      最近更新 更多