Dynamically Supporting Invalid SSL Certificates

Pull request for #764