This commit fixes some minor issues with self signed certificates. On
the way to that fix, some other issues were fixed, which I can't
remember.
This also adds a couple of log output to make it easier to understand,
what actually happens in the daemon.