Mittwoch, 29. Juni 2011

Got a new computer. Had several versions of Java preinstalled. Installed Firefox myself, Java applets didn't work.

Tried this, tried that, even installed a new JRE myself. No success.

Used procmon and found out that, after enumerating the HKLM\Software\Wow6432Node\JavaSoft\Java Runtime Environment keys, firefox tried a RegCreateKey on HKLM\SOFTWARE\Wow6432Node\mozilla.org\Mozilla which failed with "Access denied".

Started firefox with admin rights. Java worked.

Changed the permissions on HKLM\SOFTWARE\Wow6432Node\mozilla.org\Mozilla to "full access everyone" and restarted firefox without admin rights. Java worked as well.

Don't know if that's a FF5 problem, or if the pre-installation of the computer broke something, but anyway - firefox shouldn't behave like that imo.

Montag, 30. Mai 2011

Erstellen und Importieren von SSL Zertifikaten in Tomcat

Erst einen Key erstellen:
/usr/java/jdk1.6.0_23/bin/keytool -genkey -alias http://nemo.bso2001.com -dname
"cn=nemo.bso2001.com,o=bso2001,o=com" -keyalg RSA -keysize 4096
Dann daraus einen Zertifikatsrequest machen:
/usr/java/jdk1.6.0_23/bin/keytool -certreq -alias http://nemo.bso2001.com -file
nemo.bso2001.com.csr

Ich habe meine Zertifikate von www.startssl.com, da sind die kostenlos. Man braucht von dort das Rootzertifikat und das Class1-Server-Zwischenzertifikat:

wget http://www.startssl.com/certs/ca.crt
wget http://www.startssl.com/certs/sub.class1.server.ca.crt
/usr/java/jdk1.6.0_23/bin/keytool -import -trustcacerts -alias startcom.ca -file ca.crt
/usr/java/jdk1.6.0_23/bin/keytool -import -alias startcom.ca.sub -file sub.class1.server.ca.crt

Sobald man das eigene Serverzertifikat von StartSSL hat, wird dieses importiert:
/usr/java/jdk1.6.0_23/bin/keytool -import -alias http://nemo.bso2001.com -file nemo.bso2001.com.crt

Dabei zu wissen: erst wird der Key erstellt, der wird dann von keytool -list als "PrivateKeyEntry" angezeigt. Beim Import des eigenen Serverzertifikats wird dieser Private Key durch die Zertifikatsinformation ergänzt; dieser Private Key ist nachher auch das Zertifikat das Tomcat an Clients ausliefert. Deshalb müssen die Aliase beim -genkey gleich sein.
Anscheinend ist beim Root-crt (aber nicht beim Zwischencrt) auch der -trustcacerts wichtig.