我使用GF3.1.2.2,现在我需要为我的webapp应用程序配置一个让我们加密SSL证书的方法。在我用新的keystore.jks (包括Lets加密证书)更改了默认的之后,我的new应用程序运行良好,但是管理控制台没有。
server.log文件出现此错误是因为它需要默认的keytore.jks文件:
[#|2016-05-17T11:31:15.344-0400|SEVERE|glassfish3.1.2|org.glassfish.admingui|_ThreadID=72;_ThreadName=Thread-2;|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|#]
发布于 2020-02-20 09:57:27
我迟到了3年,但谁知道可能有人会读到它呢:)造成问题的原因是管理员-侦听器使用的证书不在您的新keystore中。
管理侦听器(端口4848)使用的默认证书具有别名名称“s1as”,并随Glassfish安装一起提供。此证书位于默认的Keystore keystore.jks中.
如果您用新的密钥库更改了密钥存储库,那么Glassfish就无法找到他用于管理侦听器的证书。
这很可能是解决您的问题的方法:
Easy:
./glassfish/glassfish/domains/domain1/config,然后在任何地方找到一个名为“cert-昵称”的属性,将值更改为“让我们加密证书”的别名名称。更难但更复杂:
- For that temporarily change back to your old keystore.jks.
- Login into the Admin console and go look for the Certificate NickName under `/Configurations/server-config/Http-Service/Http-Listeners/admin-listeners`. The default certificate Glassfish uses has the Name s1as.
- Just change the Certificate NickName to the Alias-Name of your Lets' Encrypt certificate and click the save button.
- Stop Glassfish
- Switch over to your new Keystore
- Start Glassfishb)如果您坚持保留旧证书,则必须通过keytool从您的“旧”密钥库中提取它,并将其导入您的新密钥存储库。
- Stop Glassfish
- Extract the old certificate with this command: keytool -export -alias myOldCertificateNickname -keystore keystore.jks -file myOldCertificate.crt
将myOldCertificateNickname替换为在步骤1!中找到的证书NickName
-将新导出的旧证书导入新的密钥库
关键工具-import -alias myOldCertificateNickname -file myOldCertificate.crt -keystore myNewKeystore.jks
-启动玻璃鱼
现在这是最重要的!!为了所有这些工作,你需要知道密码的密钥存储和证书,以及!还有玻璃鱼的MasterPW!因为Glassfish坚持这三个密码必须是相同的(MasterPW,Keystore密码,证书密码)
这里有一个很好的在线指南,用来安装玻璃鱼的证书。
https://www.ssls.com/knowledgebase/how-to-install-an-ssl-certificate-on-glassfish/
https://stackoverflow.com/questions/37281234
复制相似问题