30

今天通过启动我的 glassfish,我看到一条关于证书已过期的错误消息......

有人可以帮助我并说出我能/必须做什么吗?

这里的消息:

     ...
     [exec]
     [exec] [#|2013-08-15T08:57:42.106+0200|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=39;_ThreadName=Thread-2;|Grizzly
Framework 1.9.50 started in: 16ms - bound to [0.0.0.0:1307 6]|#]
     [exec]
     [exec] [#|2013-08-15T08:57:42.262+0200|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=Thread-2;|GlassFish
Server Open Source Edition 3.1.2.2 (5) startup time : Felix (1'1
23ms), startup services(609ms), total(1'732ms)|#]
     [exec]
     [exec] [#|2013-08-15T08:57:42.309+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.ssl.security.com.sun.enterprise.security.ssl.impl|_ThreadID=40;_ThreadName=Thread-2;|SEC5054:
Certificate has expired: [
     [exec] [
     [exec]   Version: V3
     [exec]   Subject: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
     [exec]   Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
     [exec]
     [exec]   Key:  Sun RSA public key, 2048 bits
     [exec]   modulus: 237418898293472616608124373663877543854434319738611148654904141538840503317458119685231168476255701465927369352097185652960533868421359855348631579831288127741629980536737464707822524076734022381468699944387
29551246768368782318393878374421033907597162218758024581735139682087126982809511479059100617027892880227587855877479432885604404402435662802390484099065871430585284534529627347717530352189612077130606642676951640071336717026459037
542552927905851171460589361570392199748753414855675665635003335769915908187224347232807336022456537328962095005323382940080676931822787496212635993279098588863972868266229522169377
     [exec]   public exponent: 65537
     [exec]   Validity: [From: Fri Aug 14 16:50:00 CEST 1998,
     [exec]                To: Thu Aug 15 01:59:00 CEST 2013]
     [exec]   Issuer: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
     [exec]   SerialNumber: [    01b6]
     [exec]
     [exec] Certificate Extensions: 4
     [exec] [1]: ObjectId: 2.5.29.19 Criticality=true
     [exec] BasicConstraints:[
     [exec]   CA:true
     [exec]   PathLen:5
     [exec] ]
     [exec]
     [exec] [2]: ObjectId: 2.5.29.32 Criticality=false
     [exec] CertificatePolicies [
     [exec]   [CertificatePolicyId: [1.2.840.113763.1.2.1.3]
     [exec] []  ]
     [exec] ]
     [exec]
     [exec] [3]: ObjectId: 2.5.29.15 Criticality=true
     [exec] KeyUsage [
     [exec]   Key_CertSign
     [exec]   Crl_Sign
     [exec] ]
     [exec]
     [exec] [4]: ObjectId: 2.5.29.14 Criticality=false
     [exec] SubjectKeyIdentifier [
     [exec] KeyIdentifier [
     [exec] 0000: 76 0A 49 21 38 4C 9F DE   F8 C4 49 C7 71 71 91 9D  v.I!8L....I.qq..
     [exec] ]
     [exec] ]
     [exec]
     [exec] ]
     [exec]   Algorithm: [SHA1withRSA]
     [exec]   Signature:
     [exec] 0000: 41 3A D4 18 5B DA B8 DE   21 1C E1 8E 09 E5 F1 68  A:..[...!......h
     [exec] 0010: 34 FF DE 96 F4 07 F5 A7   3C F3 AC 4A B1 9B FA 92  4.......<..J....
     [exec] 0020: FA 9B ED E6 32 21 AA 4A   76 C5 DC 4F 38 E5 DF D5  ....2!.Jv..O8...
     [exec] 0030: 86 E4 D5 C8 76 7D 98 D7   B1 CD 8F 4D B5 91 23 6C  ....v......M..#l
     [exec] 0040: 8B 8A EB EA 7C EF 14 94   C4 C6 F0 1F 4A 2D 32 71  ............J-2q
     [exec] 0050: 63 2B 63 91 26 02 09 B6   80 1D ED E2 CC B8 7F DB  c+c.&...........
     [exec] 0060: 87 63 C8 E1 D0 6C 26 B1   35 1D 40 66 10 1B CD 95  .c...l&.5.@f....
     [exec] 0070: 54 18 33 61 EC 13 4F DA   13 F7 99 AF 3E D0 CF 8E  T.3a..O.....>...
     [exec] 0080: A6 72 A2 B3 C3 05 9A C9   27 7D 92 CC 7E 52 8D B3  .r......'....R..
     [exec] 0090: AB 70 6D 9E 89 9F 4D EB   1A 75 C2 98 AA D5 02 16  .pm...M..u......
     [exec] 00A0: D7 0C 8A BF 25 E4 EB 2D   BC 98 E9 58 38 19 7C B9  ....%..-...X8...
     [exec] 00B0: 37 FE DB E2 99 08 73 06   C7 97 83 6A 7D 10 01 2F  7.....s....j.../
     [exec] 00C0: 32 B9 17 05 4A 65 E6 2F   CE BE 5E 53 A6 82 E9 9A  2...Je./..^S....
     [exec] 00D0: 53 0A 84 74 2D 83 CA C8   94 16 76 5F 94 61 28 F0  S..t-.....v_.a(.
     [exec] 00E0: 85 A7 39 BB D7 8B D9 A8   B2 13 1D 54 09 34 24 7D  ..9........T.4$.
     [exec] 00F0: 20 81 7D 66 7E A2 90 74   5C 10 C6 BD EC AB 1B C2   ..f...t\.......
     [exec]
     [exec] ]|#] ...
4

7 回答 7

40

The certificate of GTE Cybertrust Solutions inc has expired this night.

As stated here: https://forums.oracle.com/thread/2563077 the alias of this certificate is: gtecybertrust5ca

As long as it is a standalone Glassfish you can follow this guide: https://blogs.oracle.com/ramkri/entry/sec5054_certificate_has_expired_error

Link on Wayback Machine: https://web.archive.org/web/20140713065413/https://blogs.oracle.com/ramkri/entry/sec5054_certificate_has_expired_error

I have the same problem, but with the embedded Glassfish 3.1.2.2 used by Arquillian. I don't know where the certificates are stored in this embedded setup. Any hints are appreciated.

UPDATE for an embedded setup: To fix the certificate while using an embedded glassfish, just copy a fixed version of the cacerts.jks from the standalone glassfish installation <glassfish_home>/glassfish/domains/<your_domain>/config/cacerts.jks to your resource directory. E.g. when using maven and arquillian, just copy the file to <projectRoot>/src/test/resources/config/cacerts.jks. The embedded glassfish will pick up this configuration!

This is the solution from this post: Arquillian Embedded Glassfish Certificate Expired

于 2013-08-15T09:19:35.710 回答
10

我的操作系统是windows 2003系统,我解决的问题如下

  1. 我在 C:\glassfish3\jdk 7\bin 中打开了 windows 系统的 cmd 控制台,在那个文件夹中是 keytool

  2. 在 glassfish 目录中找到所有 cacerts.jks,在我的情况下,我在C:\glassfish3\glassfish\domains\domain1\configC:\glassfish3\glassfish\lib\templates中找到它们

  3. 列出来自 cacerts.jks 的所有证书,来自 java 的 keytool 可以做到这一点。我复制了 keytool 文件夹中的 cacerts.jks 文件,但如果 keytool 运行良好,则该文件是可选的: C:\glassfish3\jdk7\bin> keytool -list -v -keystore cacerts.jks -storepass changeit > listaCertificados.txt

  4. 在上一步创建的 listaCertificados.txt 文件中,我检查了所有过期的证书

  5. 我删除了 2013 年 8 月过期的 gtecybertrust5ca 认证。命令是:keytool -delete -alias gtecybertrust5ca -keystore cacerts.jks -storepass changeit

  6. 我更改了 C:\glassfish3\glassfish\domains\domain1\config 中的 cacerts.jks 名称文件,然后我将 cacerts.jks 文件从 C:\glassfish3\jdk7\bin 复制到 C:\glassfish3\glassfish\域\域1\配置

  7. 我对 C:\glassfish3\glassfish\lib\templates\cacerts.jks 应用了相同的程序

  8. 最后我重新加载了 glassfish 服务器

对不起我的英语,我不会说那种语言,但我想帮忙

于 2013-09-10T16:11:08.550 回答
10

我们还使用嵌入式 Glassfish 和 Arquillian 进行集成测试,不幸的是,在嵌入式 Glassfish 的新版本发布之前,我们无法运行任何测试。与此同时,这就是我所做的:

  1. 在本地 Maven 缓存中找到嵌入的 Glassfish jar。我的在 \path\to\local\maven\repo\org\glassfish\main\extras\glassfish-embedded-all\3.1.2\glassfish-embedded-all-3.1.2.jar
  2. 使用一些归档软件打开 JAR。我用的是 7-zip。
  3. 将 config\cacerts.jks 提取到某个文件夹。
  4. 执行 \path\to\jdk\bin\keytool -delete -v -alias gtecybertrust5ca -keystore cacerts.jks。当要求输入密码时:changeit
  5. 将 cacerts.jks 复制回 glassfish 嵌入式 jar,覆盖旧的密钥库。
  6. 再次运行测试。

刚刚在链接的帖子( https://stackoverflow.com/a/18343639/1540666 )中找到了 heather92115 的类似解决方案,我会更好一些。只需记住在发布更新的嵌入式 Glassfish 时从您的项目中删除修改后的密钥库。

于 2013-08-21T08:53:54.460 回答
4

做就是了

domain=domain1
asadmin stop-domain $domain
cd $(dirname `which asadmin`)/../glassfish/domains/config
cp cacerts.jks{,.bak}
keytool -delete -alias gtecybertrust5ca -keystore cacerts.jks -storepass changeit
cd -
asadmin start-domain $domain
于 2014-03-18T20:16:13.433 回答
1

您现在可以将证书作为 OpenJDK 包的一部分获取 - 请参阅https://dzone.com/articles/openjdk-10-now-includes-root-ca-certificates

对于 Docker 安装,您可以执行以下操作:

# Set glassfish env
ENV GLASSFISH_HOME /opt/glassfish5/glassfish

# Get latest cacerts from OpenJDK project
RUN wget https://hg.openjdk.java.net/jdk/jdk/raw-file/tip/src/java.base/share/lib/security/cacerts && \
    mv cacerts $GLASSFISH_HOME/domains/domain1/config/cacerts.jks

手动安装将是类似的

于 2019-01-09T01:43:33.440 回答
0

BoneGoat 提供的解决方案也适用于 glassfish-embedded-web-3.1.2.2.jar。由于我使用的是 Maven,因此我按照 BoneGoat 的步骤获取 jar,然后使用更新的版本名称上传到我们的本地 Nexus 存储库。然后我更新了我的依赖项:

                <groupId>org.glassfish.main.extras</groupId>
                <artifactId>glassfish-embedded-web</artifactId>
                <version>3.1.2.2-fixed-cert</version>
                <scope>test</scope>

注意:我没有运气使用 4.0 版本的 jar。(可能与 arquillian 和新版本有些不兼容。)

您还可以在此问题中找到有用的信息Arquillian Embedded Glassfish Certificate Expired

于 2013-10-02T14:03:17.353 回答
-1

其他答案中的解决方案可能有效....

但是,我建议不要浪费时间弄乱证书,只需重新安装 Glassfish,它就会得到修复。

于 2018-08-28T08:46:22.083 回答