Ugly changes to make Windows SSL fit into the new code.