fix accepting of invalid certs