Optionally ignore invalid certificates

During development, it's common to have a test server set up with invalid certificates. This patch provides a preprocessor option to disable validation of certificates.