Tuesday, May 5, 2009

Cruise Server keystore password..

Today I've been playing with thoughtworks studios' Cruise Server continuous integration software.

For those of you who were not aware, this software is the new commercial offering from the same people who brought us Cruise Control (and it's .net counterpart Cruise Control.Net).

However, even if this is a commercial product, thoughtworks offers a free 2 agents only license which you can use in smaller projects. Using such kind of license I've been trying to setup a fresh install which will build one of our internal c# based projects.

The software's architecture is almost the same as most equivalent products out there. A server side which offers a web interface into which you can review/manage building configurations and logs. And an agent/slave which will perform the actual building of software.

Both, server and agents, are available for Linux, MacOSX and Windows, and as you might guess the server is developed on java and requires a virtual machine to run.
However, windows version installs a jvm as part of the instalation process.

During my initial configuration of the software I faced an odd problem in which our Subversion server uses SSL certificates from one of our internal CAs.
This was causing CruiseServer to fail due to not being able to validate such SSL certificate.

Ok, if this is java software, there must be some keystore file into which I should add our CA root certificates.. I thought.

Well.. yes.. after inspecting a little thing you will find /etc/cruise/{keystore,truststore,agentstore}..

The problem is.. "where the hell is the document which specifies the password of such store files?".. I've tried searching thoughtworks documentation w/o any luck.. then I searched google which yielded nearly no results.. and in the end I just felt like decompiling CruiseServer's code was going to be faster..

Using the always useful "jad" (the Java Decompiler) by a couple of minutes over "cruise.war" application file.. I ended up finding what I was looking for at WEB-INF/classes/com/thoughtworks/cruise/server/CruiseServer.class.. where you can see the constant "serverKeystorepa55w0rd" being used as keystore's password.

Hope this is useful to others playing with CruiseServer too..

PD: As a side note, on my current setup our server is linux based, and our initial agent is windows based (as we will be building an application requiring .net 3.5).
It might be worth noting I'm using centos' 5.3 openjdk packages without problems, which simplifies installation a lot when comparing to manually installing sun java software, etc.