Add support for self signed certs. Closes #5391.