是的,它是可能的。
第一您需要在ApplicationRealm中添加波纹管代码
<server-identities>
<ssl>
<keystore path="server.keystore" relative-to="jboss.server.config.dir" keystore-password="abcd1234" alias="server" key-password="abcd1234"/>
</ssl>
</server-identities>
然后你需要添加lisner用于HTTP和HTTPS
<server name="default-server">
<http-listener name="default-http" socket-binding="http"/>
<https-listener name="default-https" socket-binding="https" security-realm="ApplicationRealm"/>
<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>
现在配置连接器,用于HTTP和HTTPS
<subsystem xmlns="urn:jboss:domain:remoting:2.0">
<endpoint worker="default"/>
<http-connector name="http-remoting-connector" connector-ref="default-http" security-realm="ApplicationRealm"/>
<http-connector name="https-remoting-connector" connector-ref="default-https" security-realm="ApplicationRealm"/>
</subsystem>
但一般人不会让同时启用HTTP和https。他们将请求从http重定向到https。
感谢@Moes你的例子,我现在正在尝试使用它。但是,为什么要为HTTP ApplicationRealm添加SSL配置?编辑:我看到只有1 applicationrealm,我被你的“两个” – Deim0s 2015-01-05 15:56:06
迷惑是错误的错误。正确的句子是“首先需要在ApplicationRealm中添加波纹管代码”。如果它有效,请将其标记为答案。 – Dhiren 2015-01-06 05:59:38
是的,我确认它可行,谢谢!在另一个配置文件中,我有你提到的自动重定向,这是不受欢迎的。附:请修复答案错字 – Deim0s 2015-01-09 14:28:58