CLOUDIFY-1418 fixed null checks. check for keystore null only when using secured mode