Added checks for not well defined expiration date.

As in title. I had to add a method to cert though :(
Add a test for the case where ```CertificateError``` is raised.