changes to support ssl with invalid certs

Works for me.