繁体   English   中英

如何在wildfly 8.2.0服务器中配置ssl?

[英]how to configure ssl in wildfly 8.2.0 server?

我想要我的Web应用程序的安全连接。 所以,我想为我的wildfly 8.2.0服务器配置ssl。 我在standalone / configuration文件夹中创建并存储了.keystore文件。

 $ keytool -genkey -alias foo -keyalg RSA -keystore foo.keystore   -validity 10950
Enter keystore password: secret

必须添加:

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"  redirect-port="443" />
 <connector name="https" scheme="https" protocol="HTTP/1.1" socket-binding="https" enable-lookups="false" secure="true">
<ssl name="foo-ssl" password="secret" protocol="TLSv1" key-alias="foo" certificate-key-file="../standalone/configuration/foo.keystore" />
</connector>

在standalone.xml文件中,但有标记:

<subsystem xmlns="urn:jboss:domain:remoting:2.0">
        <endpoint worker="default"/>
        <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
    </subsystem>

当我用上面指定的标签替换它时会出现错误:

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[288,106]
Message: Unexpected element '{urn:jboss:domain:web:1.1}subsystem'

我为wildfly 8.2.0配置了ssl。

第1步:创建密钥库

cd $WILDFLY_HOME/standalone/configuration
keytool -genkey -alias localhost -keyalg RSA -keystore keystore.jks -keysize 4096

第2步:编辑configuration / standalone.xml

 <management>
 <security-realms>
**<security-realm name="SslRealm">
  <server-identities>
    <ssl>
      <keystore path="keystore.jks" relative-to="jboss.server.config.dir" keystore-password="changeme"/>
    </ssl>
  </server-identities>
</security-realm>**
</security-realms>

步骤3:通过编辑standalone.xml为https添加监听器

<subsystem xmlns="urn:jboss:domain:undertow:1.2">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http"/>
**<https-listener name="default-ssl" socket-binding="https" security-realm="SslRealm"/>**

现在配置了ssl,我的网站是安全的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM