java 配置 Glassfish SSL 证书昵称的正确方法?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29278152/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Right way to configure Glassfish SSL certificate nickname?
提问by talha06
Glassfish lets to set the SSL certificate nickname through its admin console as it is highlighted in the pic below:
Glassfish 允许通过其管理控制台设置 SSL 证书昵称,如下图所示:
But almost every tutorials in the web mention that it is necessary to replace all occurrences of the default SSL nickname (s1as
) with the one will be used(i.e. mydomain.com
) in the domain.xml
file.
但几乎网络上的每个教程都提到有必要将所有出现的默认 SSL 昵称 ( s1as
) 替换mydomain.com
为domain.xml
文件中将使用的昵称(即) 。
So what is the proper way of setting certificate nickname?
那么设置证书昵称的正确方法是什么?
回答by Mike
It is very likely that the admin console is just updating the domain.xml file anyway. In either case, it is good practice to avoid modifying the domain.xml file wherever possible. There is no official advice in the Security Guide for GF4 and the only mention of the certificate nickname is:
无论如何,管理控制台很可能只是在更新 domain.xml 文件。在任何一种情况下,尽可能避免修改 domain.xml 文件是一种很好的做法。GF4 的安全指南中没有官方建议,唯一提到的证书昵称是:
If you enable secure admin on an SSL-enabled GlassFish Server installation, secure admin uses the existing value as the DAS admin alias for secure admin.
如果在启用 SSL 的 GlassFish Server 安装上启用安全管理,则安全管理将使用现有值作为安全管理的 DAS 管理别名。
https://glassfish.java.net/docs/4.0/security-guide.pdf
https://glassfish.java.net/docs/4.0/security-guide.pdf
Changing the nickname isn't actually necessary, from a functional perspective. When you import your key/cert to the keystores you can just use the same name to replace the existing cert, which is perfectly valid.
从功能的角度来看,更改昵称实际上并不是必需的。当您将密钥/证书导入密钥库时,您可以使用相同的名称来替换现有的证书,这是完全有效的。
Edit: To change alias names with the asadmin
command, you can use enable-secure-admin
with either --instancealias myNewAlias
or --adminalias myOtherNewAlias
(or both).
编辑:要使用asadmin
命令更改别名,您可以使用enable-secure-admin
with--instancealias myNewAlias
或--adminalias myOtherNewAlias
(或两者)。
The default for adminalias
is s1as
and the default for instancealias
is glassfish-instance
.
默认adminalias
ISs1as
和默认instancealias
IS glassfish-instance
。
回答by heronsanches
http-listener-2is the default http listener (glassfish or payara) with ssl enabled on port 8181, if you have created another change for it in the bellow command.
http-listener-2是默认的 http 侦听器(glassfish 或 payara),在端口 8181 上启用了 ssl,如果您在下面的命令中为它创建了另一个更改。
asadmin set "configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.cert-nickname=yourNickName"