Add a bunch of logging statements and cleanup a little whitespace.
R16 wraps the "unknown ca" message in a {tls_error, _} tuple.
Use the INDEX_RESULTS macro instead of matching on the tuple.