Add events for certificate problems.

Issue #213