Using an invalid certificate keyStore should be (at least) reported in the log rather than failing silently.

Code for loading the keyStore can throw an exception, which was
silently ignored.  By moving it inside an existing try-catch block, the
exception is reported in the log.

Also added an integration test, although I think it could be improved.