Misc fixes

- updated certificate mismatch messages properly fixes #1043
- fixed a server side segfault if client disconnects before authentication was finished