If that exception is thrown you are using the trustmanager wrongly.
There a couple of snippets around on the internet on stackoverflow and
some of the linked blog posts on the wiki .. I dont have any links or
code at hand but you will find all you need there.
manfred