Okay, also nun wie versprochen zur Aufklärung, falls es jemanden interessiert was da los war.
Und insgeheim, damit ich das nächste mal die Lösung wieder finde
Ich habe leider erst gestern bemerkt, dass keytool -list auch einen verbose output hat.
Der sah folgendermaßen aus.
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# keytool -list -v -keystore /var/subsonic/keystore/keystore
Geben Sie das Keystore-Passwort ein:
Keystore-Typ: JKS
Keystore-Provider: SUN
Ihr Keystore enthält 3 Einträge.
Aliasname: startcom.ca.sub
Erstellungsdatum: 09.03.2012
Eintragstyp: trustedCertEntry
Eigner: CN=StartCom Class 1 Primary Intermediate Server CA, OU=Secure Digital Certificate Signing, O=StartCom Ltd., C=IL
Aussteller: CN=StartCom Certification Authority, OU=Secure Digital Certificate Signing, O=StartCom Ltd., C=IL
Seriennummer: 18
Gültig von: Wed Oct 24 22:54:17 CEST 2007 bis: Tue Oct 24 22:54:17 CEST 2017
Digitaler Fingerabdruck des Zertifikats:
MD5: 30:B0:5A:F7:B2:F4:BE:0C:28:67:15:EA:CC:5B:24:20
SHA1: F6:91:FC:87:EF:B3:13:53:54:22:5A:10:E1:27:E9:11:D1:C7:F8:CF
Unterschrift-Algorithmusname: SHA1withRSA
Version: 3
Erweiterungen:
//hier habe ich gekürzt
*******************************************
*******************************************
Aliasname: startcom.ca
Erstellungsdatum: 09.03.2012
Eintragstyp: trustedCertEntry
Eigner: CN=StartCom Certification Authority, OU=Secure Digital Certificate Signing, O=StartCom Ltd., C=IL
Aussteller: CN=StartCom Certification Authority, OU=Secure Digital Certificate Signing, O=StartCom Ltd., C=IL
Seriennummer: 1
Gültig von: Sun Sep 17 21:46:36 CEST 2006 bis: Wed Sep 17 21:46:36 CEST 2036
Digitaler Fingerabdruck des Zertifikats:
MD5: 22:4D:8F:8A:FC:F7:35:C2:BB:57:34:90:7B:8B:22:16
SHA1: 3E:2B:F7:F2:03:1B:96:F3:8C:E6:C4:D8:A8:5D:3E:2D:58:47:6A:0F
Unterschrift-Algorithmusname: SHA1withRSA
Version: 3
Erweiterungen:
//hier genauso
*******************************************
*******************************************
Aliasname: home.diezotts.de
Erstellungsdatum: 09.03.2012
Eintragstyp: PrivateKeyEntry
Zertifikatskettenlänge: 1
Zertifikat[1]:
Eigner: EMAILADDRESS=postmaster@diezotts.de, CN=home.diezotts.de, C=DE, OID.2.5.4.13=1IEN1Son9H2d9kCo
Aussteller: CN=StartCom Class 1 Primary Intermediate Server CA, OU=Secure Digital Certificate Signing, O=StartCom Ltd., C=IL
Seriennummer: 5a474
Gültig von: Mon Mar 05 00:59:43 CET 2012 bis: Thu Mar 07 00:02:22 CET 2013
Digitaler Fingerabdruck des Zertifikats:
MD5: 8B:40:AD:AB:50:05:AE:48:DE:23:71:1B:43:5E:AE:DA
SHA1: 63:86:9D:73:85:09:79:78:B1:2F:7E:96:6D:7D:5F:9D:0B:E2:EA:CA
Unterschrift-Algorithmusname: SHA1withRSA
Version: 3
Erweiterungen:
//hier auch abgeschnitten
*******************************************
*******************************************
|
Das Problem war somit relativ klar:
Zertifikatskettenlänge: 1
Die "Über"–Zertifikate waren zwar im keystore, aber meins wurde, warum auch immer, nicht verkettet.
Die Lösung habe ich im Web gefunden:
Thanks Christopher Schultz and Crypto Sal for your replies!
The key hint was the certificate chain length. My problem seemed to be that I got the server certificate as PKS12 file (including the private key). I imported it using "-importkeystore -srcstoretype PKCS12". "-trustcacerts" doesnt seem to have any effects with "-importkeystore". Since the PKS12 file containd only the server certificate, it was imported with certificate chain length 1.
So here is what worked for me:
I converted the root and intermediate certificates to human readable form by importing them into a keystore and then exporting them again using "-export -rfc".
I imported my server certificate into a new keystore and adapted alias and passwords for use with my Tomcat configuration
I exported the server certificate again using "-export -rfc"
I opened the newly created export file of my server certificate and inserted the contents of the intermediate and the root certificates at the bottom of the file. This created a valid certificate chain in PKCS7 format.
I imported the altered certificate file into the same keystore using the same alias. This replaced the single certificate with the complete certificate chain (private key remained unaltered).
Now I have a valid keystore with my server certificate and the intermediate and root certificates and the certificate chain length is 3. Tomcat deliveres the chain correctly and I finally got rid of the annoying security warnings in Firefox.
Thanks for your help!
Dann habe ich das einfach genauso gemacht und es hat funktioniert.
Ich hasse es, wenn man Dinge tut, die man nicht verstanden hat.
Und den Sinn eines Keystores habe ich auch noch nicht begriffen.