1.2.5. 使用 Elytron 子系统为管理接口启用单向 SSL/TLS


在 JBoss EAP 中,您可以使用 JBoss EAP 管理 CLI 或管理控制台为管理接口启用单向 SSL/TLS。

在管理 CLI 中,可通过两种方式启用单向 SSL/TLS:

使用安全命令

security enable-ssl-management 命令可用于为管理接口启用单向 SSL/TLS。

示例:向导使用

security enable-ssl-management --interactive

Please provide required pieces of information to enable SSL:
Key-store file name (default management.keystore): keystore.jks
Password (blank generated): secret
What is your first and last name? [Unknown]: localhost
What is the name of your organizational unit? [Unknown]:
What is the name of your organization? [Unknown]:
What is the name of your City or Locality? [Unknown]:
What is the name of your State or Province? [Unknown]:
What is the two-letter country code for this unit? [Unknown]:
Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct y/n [y]?
Validity (in days, blank default): 365
Alias (blank generated): localhost
Enable SSL Mutual Authentication y/n (blank n): n

SSL options:
key store file: keystore.jks
distinguished name: CN=localhost, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown
password: secret
validity: 365
alias: localhost
Server keystore file keystore.jks, certificate file keystore.pem and keystore.csr file
will be generated in server configuration directory.
Do you confirm y/n :y
Copy to Clipboard Toggle word wrap

注意

执行命令后,管理 CLI 将重新加载服务器并重新连接该服务器。

使用 Elytron 子系统命令

elytron 子系统命令也可用于为管理接口启用单向 SSL/TLS。

  1. 配置 密钥存储.

    /subsystem=elytron/key-store=httpsKS:add(path=keystore.jks,relative-to=jboss.server.config.dir,credential-reference={clear-text=secret},type=JKS)
    Copy to Clipboard Toggle word wrap
    注意

    以上命令使用 relative-to 来引用密钥存储文件的位置。或者,您可以在路径中指定密钥存储的完整 路径,并省略 relative-to

    如果密钥存储文件尚不存在,使用以下命令来生成示例密钥对:

    /subsystem=elytron/key-store=httpsKS:generate-key-pair(alias=localhost,algorithm=RSA,key-size=1024,validity=365,credential-reference={clear-text=secret},distinguished-name="CN=localhost")
    
    /subsystem=elytron/key-store=httpsKS:store()
    Copy to Clipboard Toggle word wrap
  2. 创建 key-managerserver-ssl-context

    /subsystem=elytron/key-manager=httpsKM:add(key-store=httpsKS,algorithm="SunX509",credential-reference={clear-text=secret})
    
    /subsystem=elytron/server-ssl-context=httpsSSC:add(key-manager=httpsKM,protocols=["TLSv1.2"])
    Copy to Clipboard Toggle word wrap
    重要

    您需要了解您使用的 JDK 提供了哪些关键管理器算法。例如 ,使用 SunJSSE 的 JDK 提供 PKIXSunX509 算法。您还需要确定您要支持的 HTTPS 协议。以上示例命令使用 TLSv1.2。您可以使用 cipher-suite-filter 参数指定允许哪些密码套件,以及使用-cipher-suites-order 参数来执行服务器密码套件顺序。使用-cipher-suites-order 属性默认设置为 true。这与旧 的安全 子系统行为不同,后者默认为遵从客户端密码套件顺序。

  3. 在管理界面中启用 HTTPS。

    /core-service=management/management-interface=http-interface:write-attribute(name=ssl-context, value=httpsSSC)
    
    /core-service=management/management-interface=http-interface:write-attribute(name=secure-socket-binding, value=management-https)
    Copy to Clipboard Toggle word wrap
  4. 重新加载 JBoss EAP 实例。

    reload
    Copy to Clipboard Toggle word wrap

现在,管理接口启用了单向 SSL/TLS。

重要

如果您 同时 定义了 security-realmssl-context,JBoss EAP 将使用由 ssl-context 提供的 SSL/TLS 配置。

注意

您可以使用 disable- ssl-management 命令为管理接口禁用 单向 SSL/TLS。

security disable-ssl-management
Copy to Clipboard Toggle word wrap

此命令不会删除 Elytron 资源。它将系统配置为使用 ApplicationRealm 传统安全域进行 SSL 配置。

使用管理控制台

您可以使用管理控制台中的 SSL 向导为管理控制台使用的管理界面启用 SSL。

访问向导:

  1. 访问管理控制台。如需更多信息,请参见《JBoss EAP 配置指南 https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.3/html-single/configuration_guide/#management_console_overview 》中的管理控制台部分
  2. 导航到 Runtime,单击相应的服务器名称。
  3. 单击服务器名称旁边的 View
  4. 点击 HTTP Manageme…​ 打开 HTTP Management Interface 配置页面。
  5. 单击 Enable SSL 以启动向导。

    向导会引导您完成以下场景以启用 SSL:

    • 您需要创建证书存储并生成自签名证书。
    • 您需要从 Let 的加密认证机构获得证书。
    • 您已在文件系统中拥有证书存储,但没有密钥存储配置。
    • 您已有使用有效证书存储的密钥存储配置。

使用向导时,您可以选择为相互身份验证创建一个信任存储。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat