Report errors with keystores

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.