我有一个glassfish 4.1.1运行的实例,我将自己的证书添加到我的应用程序,直到那时一切都很好..
但是,当我尝试访问glassfish管理员(DAS)时,连接不受信任,添加异常的按钮消失 .
然后我发现了一些有趣的链接,就像:
我试过这个:
asadmin enable-secure-admin --adminalias=myNewAlias --instancealias myNewAlias
asadmin restart-domain domain1
这样,不受信任的连接消息消失并且证书正确显示,但是当我尝试身份验证时抛出错误:
根据link的答案的评论,这个人非常相似,但是我无法解决这个问题:
-
从〜.gfclient / truststore中删除s1as证书
-
使用我的新别名证书重新启动域
How could I change the s1as certificate properly? In order to my DAS works...
我正在使用Ubuntu 14和java-1.8.0-openjdk-amd64 .
第1步:
第2步:
显示以下行的服务器日志:
[2016-10-18T10:38:12.565 0200] [glassfish 4.1] [SEVERE] [] [org.glassfish.admingui] [tid:_ThreadID = 51 _ThreadName = admin-listener(2)] [timeMillis:1476779892565] [ levelValue:1000] [[javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径; javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径; restRequest:endpoint = https:// localhost:4848 / management / domain / anonymous-user-enabled attrs = {} method = GET]]
1 回答
我终于解决了它,为什么会发生这种情况?使用@Mike解释:
In my case I was trying to use my own certificate but I did not delete the oldest certificates properly on cacerts.jks and keystore.jks files.
我没有先从文件中删除s1as和glassfish-instance,而是在运行下面的代码,这是我的错误步骤......
使用您自己的证书运行Glassfish 4.1.1上的域管理服务器(DAS),您必须执行以下步骤:
1) Insert your own certificate into cacerts.jks and keystore.jks files:
在我的情况下,我使用证书pkcs12:
如果您有其他类型的证书,则必须搜索如何在这两个文件中插入您的证书类型:
参考文献:
会话6.首次启动前的安全配置:https://www.nabisoft.com/tutorials/glassfish/installing-glassfish-41-on-ubuntu
http://peter-butkovic.blogspot.com.es/2013/02/glassfish-default-keystore-and.html
https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html?jn9ed3e997=3
https://glassfish.java.net/docs/4.0/security-guide.pdf
2) Delete the oldest self-signed certificates:
默认情况下,当您运行命令enabled-secur-admin时,分配给此实例的证书为 s1as 且公共为 glassfish-instance ,正如@Mike解释为另一个stack-overflow question,即使您强制使用其他证书运行,证书仍然存在 . 使用以下命令删除两者:
参考文献:
谢谢@Mike:Right way to configure Glassfish SSL certificate nickname?
https://glassfish.java.net/docs/4.0/security-guide.pdf(第~80页)
3) Restart the security-admin with your own alias set on the first step
In theory, it is done, You'll be able to access the DAS with your own certificate... ;)