我一直在爲此奮鬥了2天。我想在本地Mac上的Wildfly 9.0.2.Final上設置https監聽器。我是新來的野蠅。我從我的生產環境中複製了我的wildfly設置(domain.xml和host.xml),但在Prod上我們有負載均衡器來路由到https流量,並且我不想在本地設置負載均衡器。我已經看過了互聯網上,走到這一步: 1.生成的自簽名證書以下鏈接: https://docs.jboss.org/author/pages/viewpage.action?pageId=66322705&_sscc=t 2.增加了一個安全領域中host.xml:Wildfly 9.0.2設置https監聽器
<security-realm name="SSLRealm">
<server-identities>
<ssl>
<keystore path="foo.keystore" relative-to="jboss.domain.config.dir" alias="foo" keystore-password="secret" key-password="secret" />
</ssl>
</server-identities>
</security-realm>
- in domain.xml我有幾個配置文件的設置,並且每個都有一個子系統管道。從我的在線搜索中,我明白我需要在承運人子系統中添加一個https監聽器。現在,我不清楚在哪個子系統中,我添加了https-listener。我仍然將它添加到我的應用程序部署下的配置文件中(因爲我希望https監聽器僅適用於本地的一個應用程序)。我的domain.xml部分在問題的末尾。
端口爲我的應用程序通過HTTP是8580(我已經設置端口偏移爲500),即,我訪問URL我的應用程序: http://localhost:8580/myApp 當我去到任何的: https://localhost/或https://localhost:8580或https://localhost:443或https://localhost/myApp 我剛剛得到「本網站無法訪問。localhost拒絕連接。」響應。 作爲新來的野蠅,我不知道我在哪裏犯了一個錯誤,也應該是訪問HTTPS URL的端口。 如果我需要提供更多信息,請讓我知道。 任何幫助將不勝感激。
<profiles>
<profile name="content-profile">
<subsystem.......
<subsystem xmlns="urn:jboss:domain:undertow:2.0">
<buffer-cache name="default"/>
<server name="default-server">
<ajp-listener name="ajp" socket-binding="ajp"/>
<http-listener name="default2" socket-binding="http" redirect-socket="https" proxy-address-forwarding="true" max-post-size="10737418240" max-parameters="5000"/>
<https-listener name="default" socket-binding="https" security-realm="SSLRealm" />
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="WildFly/9"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>
</profile>
</profiles>