implements client authentication error handling, fixes #34
Merge branch 'aoberoi-issue-34'