JBOSS 5.1 HTTPS Configuration

本文介绍了如何为JBoss 5.1启用HTTPS,包括修改server.xml文件中的Connector配置,以及调整bindings-jboss-beans.xml文件中的端口设置。通过这些步骤,解决了浏览器被重定向到错误端口的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

JBOSS 5.1 HTTPS Configuration

How can I enable the HTTPS on my JBOSS 5.1. First of all, I follow the tomcat strategy.
Configure the server.xml
D:\tool\jboss-5.1.0.GA\server\default\deploy\jbossweb.sar\server.xml
...snip...
<Connector protocol="HTTP/1.1" port="80" address="0.0.0.0"
connectionTimeout="20000" redirectPort="443" />
...snip...
<Connector protocol="AJP/1.3" port="8009" address="0.0.0.0"
redirectPort="443" />
...snip...
<Connector
protocol="HTTP/1.1"
SSLEnabled="true"
port="443"
address="0.0.0.0"
scheme="https"
secure="true"
clientAuth="false"
keystoreFile="jks file"
keystorePass="password"
sslProtocol = "TLS" />
...snip...

But still, when I visit the HTTPS page, the browser or rather say, the server send 302 to 8443 port, not 443 according to my configuration. Why does that happen? I go over the google and blog from others.

There is another configuration file placed here
D:\tool\jboss-5.1.0.GA\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml

I just find all the 8443 in this confugration file, and replace them to 443.
...snip...
<bean class="org.jboss.services.binding.ServiceBindingMetadata">
<property name="serviceName">jboss.web:service=WebServer</property>
<property name="bindingName">HttpsConnector</property>
<property name="port">443</property>
<property name="description">JBoss Web HTTPS connector socket</property>
</bean>
...snip...
<xsl:template match = "Connector">
<Connector>
<xsl:for-each select="@*">
<xsl:choose>
<xsl:when test="(name() = 'port' and . = '8080')">
<xsl:attribute name="port"><xsl:value-of select="$port" /></xsl:attribute>
</xsl:when>
<xsl:when test="(name() = 'port' and . = '8009')">
<xsl:attribute name="port"><xsl:value-of select="$portAJP" /></xsl:attribute>
</xsl:when>
<xsl:when test="(name() = 'redirectPort')">
<xsl:attribute name="redirectPort"><xsl:value-of select="$portHttps" /></xsl:attribute>
</xsl:when>
<xsl:when test="(name() = 'port' and . = '443')">
<xsl:attribute name="port"><xsl:value-of select="$portHttps" /></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates/>
</Connector>
</xsl:template>
...snip...

It works properly now.

references:
http://www.mentby.com/me-self/8443-to-443-problem.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值