Main

October 30, 2010

Getting java to trust a SSL Certificate

After fixing a few bugs in vimfluence, I tried to connect edit some wiki pages on my personal Confluence wiki which sits behind a self-signed SSL certificate. It works something like:

$ personalwiki HOME
Unable to log in to server: https://hub.example.com//rpc/soap-axis/confluenceservice-v1 with user: username.
 Cause: ; nested exception is: 
	javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
could not close pipe at ./vimfluence line 94.

A bit of an annoyance with Java is that you have to tell Java that it has to implicitly trust a self-signed SSL certificate if you want to connect to it via some jar. In my case I'm using vimfluence to connect to a wiki sitting behind a self-signed SSL certificate. To import the certificate into the keystore, one uses a binary called keytool which brings back strange memories of Actaris's biz.switch documentation from a previous joblet.

(cd /Library/Java/Home/lib/security && sudo keytool -import -keystore cacerts -alias example-wild -file ~admin/example-wild.crt)

One can easily get the SSL certificate by running:

openssl s_client -connect hub.example.com:443

Getting Crowd 2.0.7 to behave itself under SMF

I was chatting to Jerry Jelinek during the week on IM about an issue that I was working on debugging - the reason Crowd 2.0.7 was not behaving under SMF - it was being randomly killed off and never transitioning to an online state even though it's start_crowd.sh script had cleanly exited with an exit code of zero.

Looking at the scripts that Confluence and JIRA comes both of those start tomcat up with passing the argument of start to the catalina.sh script which starts tomcat up.

When doing a "svcs -p crowd" it would keep showing that the state was "offline*" - randomly it would get killed and I would have a cronjob running every minute to clear the service while digging into this.

Turns out the dear Atlassian folks regressed and put in start_crowd.sh a "run" instead of "start" for apache tomcats catalina.sh script which due to the way it starts java SMF thinks that it is still running the command and will zap the java process when the timeout comes around. So to fix this, one has to edit the start_crowd.sh and change run to start and then one is good to go. Crowd starts behaving itself while under SMF and life is good once again.

The manifests which I use for Crowd, Confluence and JIRA are available on GitHub.

September 5, 2010

Crowd randomly dying issues

Dear Lazyweb,

Does anyone have a solution for Atlassian Crowd keeping on crashing. I recently upgraded from 2.0.6 to 2.0.7 and that is were the issue started. Crowd randomly crashed every couple of minutes after startup. I have a cronjob that runs svcadm clear crowd every minute to try and keep the downtime to a minimum. Is there something like xdebug (for php) for java?

Afrigator