SSL support WIP, restructured